Radar
Radar
A radar/spider chart.
Usage
from dataviz_mojo import radar
from dataviz_mojo.plot import save
def main() raises:
var indicators: List[String] = ["Attack", "Defense", "Speed", "Stamina", "Skill"]
var max_values: List[Float64] = [100.0, 100.0, 100.0, 100.0, 100.0]
var series_names: List[String] = ["Team A", "Team B"]
var series_values: List[List[Float64]] = [
[90.0, 60.0, 80.0, 70.0, 85.0],
[65.0, 85.0, 55.0, 90.0, 60.0],
]
var c = radar(indicators, max_values, series_names, series_values)
save(c, "docs/src/examples/out_radar.svg")Args:
indicators: One spoke per entry, in the given order.max_values: Each spoke’s own independent maximum, paired withindicators[i].series_names: One polygon per name, used as the legend key.series_values:series_values[j]isseries_names[j]’s value per indicator.theme: Full styling knobs beyond this function’s own parameters (colors, margins, fonts, gridlines, …) – seeTheme’s docstring.width: Pixel width of the returnedPlot(.size()).height: Pixel height of the returnedPlot(.size()).title: The chart’s title, shown above the plot.subtitle: A secondary line shown under the title.x_title: The x-axis caption.y_title: The y-axis caption.