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

Bullet - Compact KPI vs Target

Signature

sp.bullet(title, labels, values, *, targets=None, max_vals=None, ranges=None, comparisons=None, variant="basic", **kwargs) -> Chart

Description

sp.bullet() is the unified entry point for the bullet-chart family. Inspired by Edward Tufte, a bullet packs an actual value, a target, qualitative ranges and a scale into a single horizontal row - perfect for KPI dashboards where space is precious. The variant keyword switches the visual treatment (zones, traffic light, thermometer, progress pill, dot, ghost-bar comparison) without touching the data.

Parameters

ParameterTypeDefaultDescription
titlestrrequiredChart title
labelslist[str]requiredRow labels
valueslist[float]requiredActual values
variantstr"basic"Visual style (see table)
targetslist[float]NoneTarget tick value per row
max_valslist[float]NonePer-row scale maximum (auto if 0)
rangeslist[float]NoneQualitative range threshold per row
comparisonslist[float]NoneComparison values for compare variant
widthint800Canvas width (px)
heightint300Canvas height (px, auto-grows with rows)

Returns

Chart - object with .html property and .show() method.


Signature

sp.bullet(title, labels, values, *, targets=None, max_vals=None, ranges=None, comparisons=None, variant="basic", **kwargs) -> Chart

Description

sp.bullet() est le point d entree unique pour la famille bullet. Inspire par Edward Tufte, le bullet condense valeur, cible, zones qualitatives et echelle dans une seule ligne horizontale - parfait pour des dashboards KPIs serres. Le mot-cle variant change l aspect (zones, feu tricolore, thermometre, pillule de progression, point, comparaison par barre fantome) sans toucher aux donnees.

Parametres

ParametreTypeDefautDescription
titlestrrequisTitre du graphique
labelslist[str]requisLibelles de ligne
valueslist[float]requisValeurs reelles
variantstr"basic"Style visuel (voir tableau)
targetslist[float]NoneValeur cible par ligne
max_valslist[float]NoneMaximum d echelle par ligne (auto si 0)
rangeslist[float]NoneSeuil de zone qualitative par ligne
comparisonslist[float]NoneValeurs de comparaison pour la variante compare
widthint800Largeur (px)
heightint300Hauteur (px, auto si trop petite)

Retour

Chart - objet avec propriete .html et methode .show().