StackedValueFormatter class

Formats the values of a stacked bar chart, labelling either every stack value or only the total on top of each bar. With drawWholeStack false, a stacked BarEntry gets its total (BarEntry.y) at the topmost stack value and an empty string for the others. The bar renderers pass the position in the stack, so a value that appears twice in one stack is handled correctly; a caller that formats a value itself, without the position, falls back to comparing values. Entries without a stack and drawWholeStack true format each value as it is.

The values are compared at Float precision, as Kotlin's Floats are, so a value read back from a Float buffer still matches the top of its stack.

Inheritance

Constructors

StackedValueFormatter(bool drawWholeStack, String appendix, int decimals)
Creates a stacked value formatter.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

getFormattedValue(double value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) → String
Returns the text to draw for value.
override
getStackedFormattedValue(double value, int stackIndex, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) → String
Formats one value of a stacked bar entry. The bar renderers call this instead of getFormattedValue so a formatter can tell the segments apart by position rather than by value. The default ignores the position.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited