Radar Chart Card
Card type:
radarChart

The radar chart card displays a radar/spider chart from tabular data. Radar charts are ideal for comparing multiple variables across different categories, such as skills assessments, performance metrics, or product comparisons.
In addition to the common parameters the radarChart card has the following configuration options:
Name | Type | Required | Default | Description |
---|---|---|---|---|
value | list of dict | Yes | — | The data to be plotted. Each dict represents a data point. |
fillCard | bool | No | false | When set to True , the chart will fill the entire card space including the header area. When False (default), the chart will be positioned below the header. |
label_override | dict | No | — | Optional: pretty labels for data series. |
chart_options | dict | Yes | — | Chart configuration options. See table below. |
Chart Options
Name | Type | Required | Default | Description |
---|---|---|---|---|
xKey | str | Yes | — | The property in each dict to use for the angle axis (categories). |
yKeys | list of str | Yes | — | The properties in each dict to use for the radar values (can be multiple series). |
strokeKeys | list of str | No | — | The properties in each dict to use for the stroke colors of each series. |
fillOpacity | number | No | 0.6 | Opacity of the filled area (0-1). |
strokeWidth | number | No | 2 | Width of the stroke line. |
dotSize | number | No | 4 | Size of the data points (0 to hide dots). |
defaultColors | ”monochrome” or “multicolor” | No | "monochrome" | Fallback color scheme if no color is provided in the data. |
fontSize | str | No | (auto) | Font size for labels/tooltips. (if not set, this scales with the card size). |
showLegend | bool | No | true | Whether to show the legend below the chart. |
showGrid | bool | No | true | Whether to show the polar grid. |
showAngleAxis | bool | No | true | Whether to show the angle axis labels. |
margin | dict | No | {top: 15, right: 15, bottom: 15, left: 15} | Chart margins. |
gridType | ”polygon” or “circle” | No | "polygon" | Type of polar grid to display. |
Grid Types
"polygon"
: Hexagonal grid pattern (default)"circle"
: Circular grid pattern
Examples
Simple Radar Chart
This example shows a basic radar chart for skills assessment.
import polars as pl
# Create some data
df = pl.DataFrame({
"skill": ["Programming", "Design", "Analysis", "Communication", "Leadership", "Problem Solving"],
"score": [85, 70, 90, 75, 80, 88],
})
# Convert to the format expected by the radar chart
data = df.to_dicts()
# Override labels
label_override = {
"score": {"label": "Score"},
}
datacards.publish.card(
type='radarChart',
value=data,
label="Skills Assessment",
chart_options={
"xKey": "skill",
"yKeys": ["score"],
},
label_override=label_override,
logic_view_size=(4,2),
)

Multi-Series Radar Chart
This example demonstrates multiple data series with different colors, useful for comparing different entities or time periods.
import polars as pl
# Create some data
df = pl.DataFrame({
"metric": ["Speed", "Accuracy", "Efficiency", "Quality", "Innovation", "Teamwork"],
"current": [65, 70, 30, 75, 70, 58],
"target": [90, 85, 75, 80, 85, 70],
})
# Convert to the format expected by the radar chart
data = df.to_dicts()
# Override labels
label_override = {
"current": {"label": "Current Performance"},
"target": {"label": "Target Performance"},
}
datacards.publish.card(
type='radarChart',
value=data,
label="Performance Comparison",
chart_options={
"xKey": "metric",
"yKeys": ["current", "target"],
"defaultColors": "multicolor",
},
label_override=label_override,
logic_view_size=(4,2),
)

Radar Chart with Custom Colors
This example demonstrates how to specify custom colors for each data series using the strokeKeys
option.
import polars as pl
# Create some data
df = pl.DataFrame({
"feature": ["Design", "Performance", "Security", "Usability", "Scalability", "Cost"],
"product_a": [85, 70, 90, 75, 30, 88],
"product_b": [70, 85, 75, 90, 85, 70],
"product_a_color": ["#10b981", "#10b981", "#10b981", "#10b981", "#10b981", "#10b981"],
"product_b_color": ["#ef4444", "#ef4444", "#ef4444", "#ef4444", "#ef4444", "#ef4444"],
})
# Convert to the format expected by the radar chart
data = df.to_dicts()
# Override labels
label_override = {
"product_a": {"label": "Product A"},
"product_b": {"label": "Product B"},
}
datacards.publish.card(
type='radarChart',
value=data,
label="Product Comparison",
chart_options={
"xKey": "feature",
"yKeys": ["product_a", "product_b"],
"strokeKeys": ["product_a_color", "product_b_color"],
"fillOpacity": 0.3,
"strokeWidth": 2,
"dotSize": 3,
},
label_override=label_override,
logic_view_size=(4,2),
)

Radar Chart with Circular Grid
This example shows a radar chart with a circular grid pattern instead of the default polygon grid.
import polars as pl
# Create some data
df = pl.DataFrame({
"category": ["A", "B", "C", "D", "E", "F"],
"value": [65, 80, 75, 90, 85, 70],
})
# Convert to the format expected by the radar chart
data = df.to_dicts()
# Override labels
label_override = {
"value": {"label": "Value"},
}
datacards.publish.card(
type='radarChart',
value=data,
label="Circular Grid Example",
chart_options={
"xKey": "category",
"yKeys": ["value"],
"gridType": "circle",
"fillOpacity": 0.5,
"showGrid": True,
},
label_override=label_override,
logic_view_size=(4,2),
)

Last updated on