DefaultValueFormatter class
Formats values with a fixed number of decimal digits and thousands separators, for example 1,234.50. The chart creates one with a digit count derived from its data range and uses it wherever no formatter is set.
- Inheritance
-
- Object
- IValueFormatter
- DefaultValueFormatter
Constructors
- DefaultValueFormatter(int digits)
-
Creates a formatter with
digitsdecimal digits.
Properties
- decimalDigits ↔ int
-
Number of decimal digits the formatter produces.
getter/setter pair
- format ↔ DecimalFormat
-
The number format built by setup.
getter/setter pair
- 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.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setup(
int digits) → void -
Rebuilds the number format. Does nothing when
digitsequals the current decimalDigits. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited