Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Radar Chart

Signature

sp.build_radar_chart(
    title: str,
    axes: list[str],
    series: list[list[float]],
    *,
    series_names: list[str] | None = None,
    palette: list[int] | None = None,
    fill_opacity: float = 0.25,
    width: int = 600,
    height: int = 500,
    background: str | None = None,
    max_val: float | None = None,
) -> Chart

Aliases: sp.radar, sp.radar_chart


Description

Spider / radar chart — polygon per series across radial axes. Useful for profiling entities across multiple dimensions simultaneously.


Parameters

ParameterTypeDefaultDescription
titlestrrequiredChart title
axeslist[str]requiredAxis labels (dimension names)
serieslist[list[float]]requiredOne inner list per series (same length as axes)
series_nameslist[str] | NoneNoneLegend names per series
palettelist[int] | NoneNoneSeries fill colors
fill_opacityfloat0.25Polygon fill opacity (0.0–1.0)
widthint600Canvas width
heightint500Canvas height
backgroundstr | NoneNoneBackground color
max_valfloat | NoneNoneCommon max scale value (auto if None)

Returns

Chart


Examples

Player comparison

import seraplot as sp
chart = sp.build_radar_chart(
    "Player Stats Comparison",
    axes=["Speed", "Strength", "Defense", "Dribbling", "Shooting", "Passing"],
    series_values=[[85, 70, 65, 90, 88, 82], [72, 88, 79, 68, 75, 85]],
    series_names=["Player A", "Player B"],
    palette=[0x6366f1, 0xf43f5e],
)
const sp = require('seraplot');
const chart = sp.build_radar_chart("Player Stats Comparison",
["Speed", "Strength", "Defense", "Dribbling", "Shooting", "Passing"],
{
    series_values: [[85, 70, 65, 90, 88, 82], [72, 88, 79, 68, 75, 85]],
    series_names: ["Player A", "Player B"],
    palette: [0x6366f1, 0xf43f5e]
})
import * as sp from 'seraplot';
const chart = sp.build_radar_chart("Player Stats Comparison",
["Speed", "Strength", "Defense", "Dribbling", "Shooting", "Passing"],
{
    series_values: [[85, 70, 65, 90, 88, 82], [72, 88, 79, 68, 75, 85]],
    series_names: ["Player A", "Player B"],
    palette: [0x6366f1, 0xf43f5e]
})
▶ Live Preview

See also

Signature

sp.build_radar_chart(
    title: str,
    axes: list[str],
    series: list[list[float]],
    *,
    series_names: list[str] | None = None,
    palette: list[int] | None = None,
    fill_opacity: float = 0.25,
    width: int = 600,
    height: int = 500,
    background: str | None = None,
    max_val: float | None = None,
) -> Chart

Aliases: sp.radar, sp.radar_chart


Description

Graphique radar (toile d'araignée) — un polygone par série sur des axes radiaux. Idéal pour profiler des entités sur plusieurs dimensions simultanément.


Paramètres

ParamètreTypeDéfautDescription
titlestrrequisTitre du graphique
axeslist[str]requisÉtiquettes des axes (noms des dimensions)
serieslist[list[float]]requisUne liste par série (même longueur que axes)
series_nameslist[str] | NoneNoneNoms des séries pour la légende
palettelist[int] | NoneNoneCouleurs de remplissage par série
fill_opacityfloat0.25Opacité du remplissage du polygone (0.0–1.0)
widthint600Largeur du canvas
heightint500Hauteur du canvas
backgroundstr | NoneNoneCouleur de fond
max_valfloat | NoneNoneValeur maximale commune (auto si None)

Retourne

Chart


Exemples

import seraplot as sp

chart = sp.build_radar_chart(
    "Comparaison des statistiques joueurs",
    axes=["Vitesse", "Force", "Défense", "Dribble", "Tir", "Passe"],
    series=[[85, 70, 65, 90, 88, 82], [72, 88, 79, 68, 75, 85]],
    series_names=["Joueur A", "Joueur B"],
    palette=[0x6366f1, 0xf43f5e],
)

Voir aussi