Skip to content

Type Alias: BaseWaterfallTrace ​

ts
type BaseWaterfallTrace = Omit<CommonTraceAttributes, 'hoverinfo'> &
  CartesianTraceAttributes &
  object;

Waterfall: bars showing how a running total is built from positive and negative changes, with sum bars and connector lines.

Type Declaration ​

NameTypeDescription
alignmentgroup?stringTraces on the same position axis with the same alignment group split each position between their offset groups; different alignment groups lay out independently.
base?numberWhere the waterfall starts on the value axis (default 0): every bar is drawn relative to it.
cliponaxis?booleanClip labels to the plot area. false is not drawn yet: labels are always clipped to the subplot.
connector?WaterfallTraceConnectorLines connecting each bar to the next.
constraintext?"inside" | "outside" | "both" | "none"Shrink labels (inside, outside, or both) so they are no larger than their bar.
decreasing?WaterfallTraceDecreasingStyle of falling bars (relative measures below zero).
dx?numberStep between implicit x coordinates (see x0).
dy?numberStep between implicit y coordinates (see y0).
hoverinfo?PerPoint< | "name" | "x" | "y" | "text" | "initial" | "delta" | "final" | `${"name" | "x" | "y" | "text" | "initial" | "delta" | "final"}+${string}` | "all" | "none" | "skip">Which fields hover labels show: the position and value (x, y), text, the running total before (initial) and after (final) the bar and its change (delta, with ▲ or ▼) and the trace name; 'skip' also turns hover events off for this trace. Default 'all'.
increasing?WaterfallTraceIncreasingStyle of rising bars (relative measures at or above zero).
insidetextanchor?"end" | "middle" | "start"Where inside labels sit along the bar.
insidetextfont?BarTraceInsidetextfontFont of labels inside bars. Defaults to textfont, with a color contrasting the bar fill.
measure?DataColumnWhat each value is: 'relative' (the default: a change added to the running total), 'total' (a bar showing the running total; its own value is ignored) or 'absolute' (a bar resetting the running total to its value). 'r', 't' and 'a' work too.
offset?PerPointNumberShift of the bar's leading edge from its position, in position-axis units, one value or one per bar. Default: centered in its (group) slot.
offsetgroup?stringTraces with the same offset group share one slot in group mode (and stack together in stack/relative modes); bars at the same position line up, also across subplots on the same position axis.
orientation?"v" | "h"'v': vertical bars at x positions with y values; 'h': horizontal bars at y positions with x values. Defaults to 'h' when only x is given.
outsidetextfont?BarTraceOutsidetextfontFont of labels outside bars. Defaults to textfont.
text?PerPoint<string | number>Text per bar, drawn per textposition and shown in hover labels.
textangle?number | "auto"Label rotation in degrees, clockwise. 'auto' turns inside labels 90° when that fits the bar better.
textfont?BarTraceTextfontFont of bar labels. Defaults to layout.font.
textinfo?| "label" | "text" | "initial" | "delta" | "final" | `${"label" | "text" | "initial" | "delta" | "final"}+${string}` | "none"What bar labels show, in a fixed order (label, text, initial, delta, final), one per line, formatted like the axes. Unset: text. Totals are computed per trace.
textposition?PerPoint<"inside" | "outside" | "auto" | "none">Where bar labels go: inside (against the bar end, see insidetextanchor), outside (past the bar end; inner bars of a stack stay inside), auto (inside when it fits, else outside), none.
texttemplate?PerPoint<string | number>Template for bar labels, overriding textinfo and text: %{initial}, %{delta} and %{final} (the running total before and after the bar, and its change), %{label} (position), %{value}, %{x}, %{y}, %{text}, %{customdata}, %{meta}, with optional d3 formats (%{delta:+.1f}).
totals?WaterfallTraceTotalsStyle of sum bars (total and absolute measures).
type"waterfall"Trace type.
width?PerPointNumberBar width in position-axis units (category slots, or ms on date axes: 86400000 is one day), one value or one per bar. Default: the slot left by layout.bargap and the bar mode. Minimum: 0
x?DataColumnx coordinates: bar positions for vertical bars, bar lengths otherwise. Numbers, dates or category names depending on the axis type.
x0?unknownStarting x coordinate when x is not given: bar i is at x0 + i·dx.
xperiod?unknownOnly on date or linear x axes: snap each x value to its period of this length (ms, or 'M<n>' months on date axes), positioned per xperiodalignment.
xperiod0?unknownA period boundary for xperiod. Default: 2000-01-01 on date axes (a Sunday for weekly periods), 0 otherwise.
xperiodalignment?"start" | "middle" | "end"Where points sit within their xperiod.
y?DataColumny coordinates: bar positions for horizontal bars, bar lengths otherwise. Numbers, dates or category names depending on the axis type.
y0?unknownStarting y coordinate when y is not given: bar i is at y0 + i·dy.
yperiod?unknownOnly on date or linear y axes: snap each y value to its period of this length (ms, or 'M<n>' months on date axes), positioned per yperiodalignment.
yperiod0?unknownA period boundary for yperiod. Default: 2000-01-01 on date axes (a Sunday for weekly periods), 0 otherwise.
yperiodalignment?"start" | "middle" | "end"Where points sit within their yperiod.
zorder?numberStacking order among the traces of a subplot: higher is drawn on top. At equal zorder, bars draw below scatter traces (Plotly’s layer order), then in trace order.

Released under the MIT License.