Sum labels rendered above stacked bar groups — pure SVG, zero JS.
Inspired by Nivo's BarTotals layer. Renders <text> elements showing
the total value at the top of each stacked bar group.
Designed to be composed inside a bar chart or xy_chart SVG.
Examples
<.bar_totals totals={[
%{x: 72.0, y: 20.0, label: "350"},
%{x: 152.0, y: 30.0, label: "280"}
]} />
Summary
Functions
Attributes
totals(:list) (required) - List of%{x, y, label}for each group total.font_size(:string) - Override font size (defaults to theme). Defaults tonil.offset(:integer) - Pixels above bar top. Defaults to6.theme(:map) - Chart theme overrides. Defaults to%{}.class(:string) - Defaults tonil.- Global attributes are accepted.