ChartValueFormatters

Standard ChartValueFormatter factories.

Finite values are rounded half away from zero using the decimal representation returned by abs(value).toString(), not the exact binary fraction. Scientific notation is expanded, and negative zero is suppressed. Nonfinite values are displayed as NaN, Infinity, and -Infinity.

This assumes the platform's Double string uses decimal digits, an optional dot, and an optional e/E exponent. Last-digit differences between platform string representations can affect rounding at a boundary.

Functions

Link copied to clipboard

Formats a value in the default selected-value format with the given prefix prepended, e.g. prefix("$") formats 3.0 as $3.0.

Link copied to clipboard

Formats a value in the default selected-value format with the given suffix appended, e.g. suffix("%") formats 41.7 as 41.7%.