A radar chart shows multivariate data of three or more quantitative variables mapped onto an axis.
For a radar chart we must define anrx.recharts.radar()
component for each set of values we wish to plot. Eachrx.recharts.radar()
component has adata_key
which clearly states which variable in our data we are plotting. In this simple example we plot theA
column of our data against thesubject
column which we set as thedata_key
inrx.recharts.polar_angle_axis
.
We can also add two radars on one chart by using tworx.recharts.radar
components.
In this plot aninner_radius
and anouter_radius
are set which determine the chart's size and shape. Theinner_radius
sets the distance from the center to the innermost part of the chart (creating a hollow center if greater than zero), while theouter_radius
defines the chart's overall size by setting the distance from the center to the outermost edge of the radar plot.
Thedot
prop shows points at each data vertex when true.legend_type="line"
displays a line in the chart legend.animation_begin=0
starts the animation immediately,animation_duration=8000
sets an 8-second animation, andanimation_easing="ease-in"
makes the animation start slowly and speed up. These props control the chart's appearance and animation behavior.
Chart data tied to a State var causes the chart to automatically update when thestate changes, providing a nice way to visualize data in response to userinterface elements. View the "Data" tab to see the substate driving thisradar chart of character traits.
Strength
15
Dexterity
15
Constitution
15
Intelligence
15
Wisdom
15
Charisma
15
Remaining points: 10
API Reference
rx.recharts.RadarChart
A Radar chart component in Recharts.
Prop | Type | Values | Default |
---|---|---|
data | Sequence |
|
margin | Dict[str, Any] | {"top": 0, "right": 0, "left": 0, "bottom": 0} |
cx | Union[str, int] | "50%" |
cy | Union[str, int] | "50%" |
start_angle | int | 90 |
end_angle | int | -270 |
inner_radius | Union[str, int] | 0 |
outer_radius | Union[str, int] | "80%" |
width | Union[str, int] | Var.create("100%") |
height | Union[str, int] | Var.create("100%") |
Valid Children
PolarAngleAxis
PolarRadiusAxis
PolarGrid
Legend
GraphingTooltip
Radar
Event Triggers
See the full list of default event triggersrx.recharts.Radar
A Radar chart component in Recharts.
Prop | Type | Values | Default |
---|---|---|
data_key | Union[str, int] |
|
points | Sequence |
|
dot | Union[dict, bool] | True |
stroke | Union[str, Color] | rx.color("accent", 9) |
fill | Union[str, Color] | rx.color("accent", 3) |
fill_opacity | float | 0.6 |
legend_type | "circle" | "cross" | ... | "rect" |
label | Union[dict, bool] | True |
is_animation_active | bool | True in CSR, and False in SSR |
animation_begin | int | 0 |
animation_duration | int | 1500 |
animation_easing | "ease" | "ease-in" | ... | "ease" |
Valid Children
LabelList
Event Triggers
See the full list of default event triggersTrigger | Description |
---|---|
on_animation_start | The on_animation_start event handler is called when the animation starts. It receives the animation name as an argument. |
on_animation_end | The on_animation_end event handler is called when the animation ends. It receives the animation name as an argument. |