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

Bar Charts

Signature

sp.bar(title, labels=None, values=None, *, variant="basic", series=None, **kwargs) -> Chart

Description

sp.bar() is the unified entry point for the entire bar-chart family. The variant keyword selects the rendering strategy — all other arguments remain consistent across variants.

Parameters

ParameterUsed by variants
bar_gapgrouped_stacked, relative
bargroup_gapgrouped_stacked
category_labelsgrouped, grouped_stacked, marimekko, multicategory, relative
color_groupsbasic
color_hexbasic, deluxe, pictogram, prism
corner_radiusgrouped_stacked, relative
gridlinesbasic, deluxe, grouped, grouped_stacked, marimekko, multicategory, prism, relative
heightall
hoverbasic, deluxe, grouped, prism
icon_sizepictogram
labelsbasic, deluxe, pictogram, prism
legend_positiongrouped, grouped_stacked, marimekko, multicategory, relative
max_icons_per_columnpictogram
offset_groupsgrouped_stacked
orientationgrouped
paletteall
seriesgrouped, grouped_stacked, marimekko, multicategory, relative
show_textbasic, deluxe, grouped, marimekko, prism
sort_orderbasic, grouped
super_categoriesmulticategory
titleall
unit_descriptionpictogram
units_per_iconpictogram
valuesbasic, deluxe, multicategory, pictogram, prism
widthall
widthsmarimekko
x_labelbasic, grouped, grouped_stacked, marimekko, multicategory, relative
y_labelbasic, grouped, grouped_stacked, marimekko, multicategory, relative

Returns

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