billboard.js
billboard.js copied to clipboard
inconsistency in the scaling of the y-axes
Description
In the example below we have 3 data rows.
Data1 and Data2 are grouped and assigned to the y-Axis.
Data3 is assigned to the y2-Axis.
When setting bar.zerobased: false
it results in following chart:
I would expect the y2-Axis to be also scaled like the y-Axis, as all values on this axis are positive too. I see no reason here to treat the y2-axis differently from the y-axis in this case.
The same happens when the data is not grouped at all:
In this case data3 on y2-axis is not scaled.
Using bar.zerobased: true
leads to following and correct result:
Removing data2 from the chart and setting bar.zerobased: false
results in this chart:
Here I would also expect for both axes to be scaled like the Y-Axis in Screenshot 1 (the stacked bars)
bar.zerobased: true
scales as expected:
Having 2 grouped data rows on each axis results in both being scaled correctly:
Same with all 4 data rows being not grouped:
Overall, it seems like there is an inconsistency how the grouped data affects the scaling of the y-axes. It seems like you need at least 2 data rows per group for the scaling to work as expected.
Is the "wrong" behavior I described above the expected behavior, or can we classify this as a bug?
Steps to check or reproduce
https://jsfiddle.net/michkami/a9uzyrs8/