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

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

ParameterTypeDefaultDescription
titlestrrequiredChart title
labelslist[str]requiredSlice labels
valueslist[float]requiredSlice values
show_pctboolTrueShow percentage labels
extrusionfloat0.2Depth of pie extrusion
bg_colorstr"#1a1a2e"Background color
palettelist[int] | NoneNoneCustom palette
widthint700Canvas width
heightint600Canvas height
hover_jsonstr | NoneNoneCustom 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ètreTypeDéfautDescription
titlestrrequisTitre du graphique
labelslist[str]requisÉtiquettes des parts
valueslist[float]requisValeurs des parts
show_pctboolTrueAfficher les pourcentages
extrusionfloat0.2Profondeur d'extrusion
bg_colorstr"#1a1a2e"Couleur de fond
palettelist[int] | NoneNonePalette personnalisée
widthint700Largeur du canvas
heightint600Hauteur du canvas
hover_jsonstr | NoneNoneJSON 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],
)

Voir aussi