Stacks topic

Stacking converts lengths into contiguous position intervals. For example, a bar chart of monthly sales might be broken down into a multi-series bar chart by category, stacking bars vertically and applying a categorical color encoding. Stacked charts can show overall value and per-category value simultaneously; however, it is typically harder to compare across categories as only the bottom layer of the stack is aligned. So, chose the stack order carefully, and consider a streamgraph. (See also grouped charts.)

Like the pie generator, the stack generator does not produce a shape directly. Instead it computes positions which you can then pass to an area generator or use directly, say to position bars.

Classes

Stack<K, T> Stacks
Stacking converts lengths into contiguous position intervals.

Functions

stackOffsetDiverging(List<List<List<num>>> series, List<int> order) → void Stack offsets Stacks
Positive values are stacked above zero, negative values are stacked below zero, and zero values are stacked at zero.
stackOffsetExpand(List<List<List<num>>> series, List<int> order) → void Stack offsets Stacks
Applies a zero baseline and normalizes the values for each point such that the topline is always one.
stackOffsetNone(List<List<List<num>>> series, List<int> order) → void Stack offsets Stacks
Applies a zero baseline.
stackOffsetSilhouette(List<List<List<num>>> series, List<int> order) → void Stack offsets Stacks
Shifts the baseline down such that the center of the streamgraph is always at zero.
stackOffsetWiggle(List<List<List<num>>> series, List<int> order) → void Stack offsets Stacks
Shifts the baseline so as to minimize the weighted wiggle of layers.
stackOrderAppearance(List<List<List<num>>> series) List<int> Stack orders Stacks
Returns a series order such that the earliest series (according to the maximum value) is at the bottom.
stackOrderAscending(List<List<List<num>>> series) List<int> Stack orders Stacks
Returns a series order such that the smallest series (according to the sum of values) is at the bottom.
stackOrderDescending(List<List<List<num>>> series) List<int> Stack orders Stacks
Returns a series order such that the largest series (according to the sum of values) is at the bottom.
stackOrderInsideOut(List<List<List<num>>> series) List<int> Stack orders Stacks
Returns a series order such that the earliest series (according to the maximum value) are on the inside and the later series are on the outside.
stackOrderNone(List<List<List<num>>> series) List<int> Stack orders Stacks
Returns the given series order [0, 1, … n - 1] where n is the number of elements in series. Thus, the stack order is given by the key accessor (see Stack.keys).
stackOrderReverse(List<List<List<num>>> series) List<int> Stack orders Stacks
Returns the reverse of the given series order [n - 1, n - 2, … 0] where n is the number of elements in series. Thus, the stack order is given by the reverse of the key accessor (see Stack.keys).