StyleCode - Number Pipeline
This pipeline controls the pretty-printing of numbers. The main behaviour is determined by the
old: use the old rendering system to base the format on the “unit”. This option will be removed once the old rendering system will disappear.
auto: collects all numbers within the same scope (a table column, a linechart series or axis, etc.) and picks a scale and precision. This is currently the default behaviour, unless overridden by the unit.
simple: numbers are displayed as floating-point values with a certain number of trailing digits.
fixed, but values are divided by 1000, 1000000 and 100 respectively, and use a
scientific: numbers are displayed in scientific format
Yis chosen so that
Xhas exactly one digit.
secondsuse the separate “time value” pipeline
Selecting the scale and suffix
The common point between
scientific is that they choose a scale and a suffix according to this table:
|The power of ten |
|Complex, see below.|
auto, an algorithm examines a set of numbers and determines a scale among
10^-9 (and associated prefixes
10⁻⁹), and a precision, by trying to get the most visually appealing reasult when this scale, prefix and precision are applied to all numbers in the set.
The details of this optimization are implementation-defined (outside the scope of this specification) but the general idea is that the algorithm attempts to minimize noise digits (displaying
1.00 creates two digits of noise) as well as lost digits (displaying
1 loses two digits of data).
Each number on an Envision dashboard belongs to exactly one set of numbers, which will be considered together for the purpose of this optimization. These sets are:
- All the numbers on a given axis of a
- All the numbers on a given
- All the numbers in a given
All other numbers are considered alone.
Selecting the precision
The number will be displayed in format
"X.Y", and the precision determines the number of digits in
Y (a value between 0 and 16). This is a form of rounding, so
10.996 displayed with a precision of 2 becomes
auto, this precision has already been selected in the previous step.
The algorithm computes the number of significant digits
D by looking for a sequence
999 in the decimal expansion of the number. For example:
This number of significant digits
D is then clamped between
precision according to the following formula:
D = max(minPrecision, min(precision, D))
In other words:
D should be between
Rendering the number
The rendering format is
[unit-left]is the value of
unit, but only if
[integer]is the integer portion of
Number / Scale.
[decimal-sep]is the value of
fractionSeparator. It only appears if the number of significant digits
[fraction]is the fractional portion of
Number / Scale, rounded to the number of significant digits
[suffix]is the suffix determined along with the scale.
[unit-right]is the value of
unit, but only if
[fraction] are combined in groups of three and separated by
Time Value pipeline
numbers property is
seconds, a distinct pipeline is used that ignores all the other properties (except units). The rules are:
minutes, the value is interpreted as a number of minutes, rounded to the nearest integer, and displayed with a
d.hh:mmif it represented more than 24 hours).
seconds, the value is interpreted as a number of seconds and displayed with a
hh:mm:ss.fif it represented more than 60 minutes,
d.hh:mm:ss.fif it represented more than 24 hours). The fractional portion is only included if necessary.
If provided, the unit is displayed according to