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

Slideshow

Signature

sp.build_slideshow(
    charts: list[Chart],
    *,
    title: str = "",
    width: int = 1000,
    height: int = 600,
    background: str | None = None,
    autoplay: bool = False,
    interval_ms: int = 3000,
) -> Chart

Aliases: sp.slideshow


Description

Wraps multiple charts in an interactive slideshow with Previous / Next navigation controls. All charts are pre-rendered; switching slides requires no server round-trip.


Parameters

ParameterTypeDefaultDescription
chartslist[Chart]requiredChart objects to display
titlestr""Slideshow title
widthint1000Container width in pixels
heightint600Container height in pixels
backgroundstr | NoneNoneBackground color
autoplayboolFalseAuto-advance slides
interval_msint3000Auto-advance interval in milliseconds

Returns

Chart (composite)


Examples

Quarterly report slideshow

import seraplot as sp
slides = [
    sp.build_bar_chart("Q1 Revenue", labels=["A","B","C"], values=[120,80,95]),
    sp.build_line_chart("Growth Trend", labels=["Jan","Feb","Mar"], values=[10,14,18]),
    sp.build_pie_chart("Market Share", labels=["Us","Them"], values=[55,45]),
]
deck = sp.build_slideshow(slides, title="Q1 Board Deck")
const sp = require('seraplot');
const slides = [
    sp.build_bar_chart("Q1 Revenue",
["A", "B", "C"],
{
    values: [120, 80, 95]
}),
    sp.build_line_chart("Growth Trend",
["Jan", "Feb", "Mar"],
{
    values: [10, 14, 18]
}),
    sp.build_pie_chart("Market Share",
["Us", "Them"],
{
    values: [55, 45]
}),
]
const deck = sp.build_slideshow(slides,
"Q1 Board Deck")
import * as sp from 'seraplot';
const slides: number[] = [
    sp.build_bar_chart("Q1 Revenue",
["A", "B", "C"],
{
    values: [120, 80, 95]
}),
    sp.build_line_chart("Growth Trend",
["Jan", "Feb", "Mar"],
{
    values: [10, 14, 18]
}),
    sp.build_pie_chart("Market Share",
["Us", "Them"],
{
    values: [55, 45]
}),
]
const deck = sp.build_slideshow(slides,
"Q1 Board Deck")
▶ Live Preview

See also

Signature

sp.build_slideshow(
    charts: list[Chart],
    *,
    title: str = "",
    width: int = 1000,
    height: int = 600,
    background: str | None = None,
    autoplay: bool = False,
    interval_ms: int = 3000,
) -> Chart

Aliases: sp.slideshow


Description

Emballe plusieurs graphiques dans un diaporama interactif avec navigation Précédent/Suivant. Tous les graphiques sont pré-rendus ; la navigation ne nécessite aucun aller-retour serveur.


Paramètres

ParamètreTypeDéfautDescription
chartslist[Chart]requisObjets Chart à afficher
titlestr""Titre du diaporama
widthint1000Largeur du conteneur en pixels
heightint600Hauteur du conteneur en pixels
backgroundstr | NoneNoneCouleur de fond
autoplayboolFalseAvance automatique des diapositives
interval_msint3000Intervalle d'avance automatique en millisecondes

Retourne

Chart (composite)


Exemples

import seraplot as sp

diapositives = [
    sp.build_bar_chart("CA T1", labels=["A","B","C"], values=[120,80,95]),
    sp.build_line_chart("Tendance", labels=["Jan","Fév","Mar"], values=[10,14,18]),
    sp.build_pie_chart("Parts de marché", labels=["Nous","Eux"], values=[55,45]),
]

presentation = sp.build_slideshow(diapositives, title="Rapport T1")

Voir aussi