billboard.js icon indicating copy to clipboard operation
billboard.js copied to clipboard

inconsistency in the scaling of the y-axes

Open michkami opened this issue 11 months ago • 4 comments

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: grafik

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: grafik In this case data3 on y2-axis is not scaled.

Using bar.zerobased: true leads to following and correct result: grafik

Removing data2 from the chart and setting bar.zerobased: false results in this chart: grafik 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: grafik

Having 2 grouped data rows on each axis results in both being scaled correctly: grafik

Same with all 4 data rows being not grouped: grafik

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/

michkami avatar Mar 12 '24 14:03 michkami