For bar
chart, by default zero values will not be plotted and will leave an empty space both in stacked and non-stacked bar charts. But if it is required to have zero values leave a hint, an option mapZeroValueTo
can be configured inside data-opts to map zero values to a non-zero decimal value. See the below demonstrations:
6.1.1 Bar Chart with Zero Values in Set | ||
|
||
6.1.2 Bar Chart with Mapped Zero Values in Set | ||
|
||
6.1.3 Stacked Bar Chart with Zero Values in Sets | ||
|
||
6.1.4 Stacked Bar Chart with Mapped Zero Values in Sets | ||
|
||
For line
charts, by default markers on zero values will tend to touch the zero axis. The behavior can be overridden by providing a mapper function. Zeros values in line
charts cannot be plotted as empty spaces because a Line series is supposed to be a connected series thus zero values should be normalised to valid decimal values. The normalisation can be calculated based on values occurring before or after the zero value or by some algorithm applied on zero value's set or all sets. To allow this a mapper function can be provided by zeroValueMapperFn
inside data-opts. The value of zeroValueMapperFn
must be the name of a function present in global (window) scope. For each zero value this function will be called with the following parameters injected in order:
undefined
if start of set.undefined
if end of set.6.2.1 Line Chart with Zero Values in Sets | ||
|
||
6.2.2 Line Chart with Disconnected Zero Values | ||
|
||
6.2.3 Stacked Line Chart with Mapped Zero Values in Sets | ||
|
|
|
6.2.4 Stacked Line Chart with Zero Values in Sets | ||
|
||
6.2.5 Stacked Line Chart with Disconnected Zero Values | ||
|
||
6.2.6 Stacked Line Chart with Mapped Zero Values in Sets | ||
|
|
|