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

Dumbbell Chart 3D

Signature

sp.build_dumbbell3d_chart(
    title: str,
    labels: list[str],
    values_start: list[float],
    values_end: list[float],
    *,
    color_start: int = 0x6366f1,
    color_end: int = 0xf43f5e,
    bg_color: str = "#1a1a2e",
    width: int = 900,
    height: int = 600,
    x_label: str = "",
    y_label: str = "",
    z_label: str = "",
    show_text: bool = False,
) -> Chart

Aliases: sp.dumbbell3d


Description

Dumbbell chart in 3D — connects start and end spheres with a 3D tube.


Parameters

ParameterTypeDefaultDescription
titlestrrequiredChart title
labelslist[str]requiredCategory labels
values_startlist[float]requiredStart values
values_endlist[float]requiredEnd values
color_startint0x6366f1Start sphere color
color_endint0xf43f5eEnd sphere color
bg_colorstr"#1a1a2e"Background
widthint900Canvas width
heightint600Canvas height
show_textboolFalseShow value labels

Returns

Chart


Examples

import seraplot as sp
chart = sp.build_dumbbell3d_chart(
    "Before vs After 3D",
    labels=["Group A", "Group B", "Group C"],
    values_start=[40, 55, 70],
    values_end=[60, 75, 85],
)
const sp = require('seraplot');
const chart = sp.build_dumbbell3d_chart("Before vs After 3D",
["Group A", "Group B", "Group C"],
[40, 55, 70],
{
    values_end: [60, 75, 85]
})
import * as sp from 'seraplot';
const chart = sp.build_dumbbell3d_chart("Before vs After 3D",
["Group A", "Group B", "Group C"],
[40, 55, 70],
{
    values_end: [60, 75, 85]
})
▶ Live Preview

See also

Signature

sp.build_dumbbell3d_chart(
    title: str,
    labels: list[str],
    values_start: list[float],
    values_end: list[float],
    *,
    color_start: int = 0x6366f1,
    color_end: int = 0xf43f5e,
    bg_color: str = "#1a1a2e",
    width: int = 900,
    height: int = 600,
    x_label: str = "",
    y_label: str = "",
    z_label: str = "",
    show_text: bool = False,
) -> Chart

Aliases: sp.dumbbell3d


Description

Graphique haltère 3D — connecte les sphères de début et de fin avec un tube 3D.


Paramètres

ParamètreTypeDéfautDescription
titlestrrequisTitre du graphique
labelslist[str]requisÉtiquettes des catégories
values_startlist[float]requisValeurs de départ
values_endlist[float]requisValeurs d'arrivée
color_startint0x6366f1Couleur de la sphère de départ
color_endint0xf43f5eCouleur de la sphère d'arrivée
bg_colorstr"#1a1a2e"Couleur de fond
widthint900Largeur du canvas
heightint600Hauteur du canvas
show_textboolFalseAfficher les étiquettes de valeur

Retourne

Chart


Exemples

import seraplot as sp

chart = sp.build_dumbbell3d_chart(
    "Avant vs Après 3D",
    labels=["Groupe A", "Groupe B", "Groupe C"],
    values_start=[40, 55, 70],
    values_end=[60, 75, 85],
)

Voir aussi