Pie Chart 3D
Signature
sp.build_pie3d_chart(
title: str,
labels: list[str],
values: list[float],
*,
show_pct: bool = True,
extrusion: float = 0.2,
bg_color: str = "#1a1a2e",
palette: list[int] | None = None,
width: int = 700,
height: int = 600,
hover_json: str | None = None,
) -> Chart
Aliases: sp.pie3d
Description
3D pie chart rendered as extruded arc segments in a WebGL scene.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
title | str | required | Chart title |
labels | list[str] | required | Slice labels |
values | list[float] | required | Slice values |
show_pct | bool | True | Show percentage labels |
extrusion | float | 0.2 | Depth of pie extrusion |
bg_color | str | "#1a1a2e" | Background color |
palette | list[int] | None | None | Custom palette |
width | int | 700 | Canvas width |
height | int | 600 | Canvas height |
hover_json | str | None | None | Custom hover JSON |
Returns
Chart
Examples
import seraplot as sp
chart = sp.build_pie3d_chart(
"Market Share 3D",
labels=["Chrome", "Safari", "Firefox", "Edge"],
values=[65, 19, 4, 4],
)const sp = require('seraplot');
const chart = sp.build_pie3d_chart("Market Share 3D",
["Chrome", "Safari", "Firefox", "Edge"],
{
values: [65, 19, 4, 4]
})import * as sp from 'seraplot';
const chart = sp.build_pie3d_chart("Market Share 3D",
["Chrome", "Safari", "Firefox", "Edge"],
{
values: [65, 19, 4, 4]
})▶ Live Preview
See also
Signature
sp.build_pie3d_chart(
title: str,
labels: list[str],
values: list[float],
*,
show_pct: bool = True,
extrusion: float = 0.2,
bg_color: str = "#1a1a2e",
palette: list[int] | None = None,
width: int = 700,
height: int = 600,
hover_json: str | None = None,
) -> Chart
Aliases: sp.pie3d
Description
Camembert 3D rendu comme des segments d'arc extrudés dans une scène WebGL.
Paramètres
| Paramètre | Type | Défaut | Description |
|---|---|---|---|
title | str | requis | Titre du graphique |
labels | list[str] | requis | Étiquettes des parts |
values | list[float] | requis | Valeurs des parts |
show_pct | bool | True | Afficher les pourcentages |
extrusion | float | 0.2 | Profondeur d'extrusion |
bg_color | str | "#1a1a2e" | Couleur de fond |
palette | list[int] | None | None | Palette personnalisée |
width | int | 700 | Largeur du canvas |
height | int | 600 | Hauteur du canvas |
hover_json | str | None | None | JSON d'infobulle personnalisée |
Retourne
Chart
Exemples
import seraplot as sp
chart = sp.build_pie3d_chart(
"Parts de marché 3D",
labels=["Chrome", "Safari", "Firefox", "Edge"],
values=[65, 19, 4, 4],
)