Skip to Content
DataCards 2.2.4 is released 🎉

Radar Chart Card

Card type: radarChart

Radar chart card

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:

NameTypeRequiredDefaultDescription
valuelist of dictYesThe data to be plotted. Each dict represents a data point.
fillCardboolNofalseWhen 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_overridedictNoOptional: pretty labels for data series.
chart_optionsdictYesChart configuration options. See table below.

Chart Options

NameTypeRequiredDefaultDescription
xKeystrYesThe property in each dict to use for the angle axis (categories).
yKeyslist of strYesThe properties in each dict to use for the radar values (can be multiple series).
strokeKeyslist of strNoThe properties in each dict to use for the stroke colors of each series.
fillOpacitynumberNo0.6Opacity of the filled area (0-1).
strokeWidthnumberNo2Width of the stroke line.
dotSizenumberNo4Size 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.
fontSizestrNo(auto)Font size for labels/tooltips. (if not set, this scales with the card size).
showLegendboolNotrueWhether to show the legend below the chart.
showGridboolNotrueWhether to show the polar grid.
showAngleAxisboolNotrueWhether to show the angle axis labels.
margindictNo{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), )
Simple radar chart example

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), )
Multi-series radar chart example

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 custom colors example

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), )
Radar chart with circular grid example
Last updated on