-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inconsistency in the scaling of the y-axes #3691
Comments
@michkami Let's say, given values are 300 and 500, in this case, min=300 and max=500. So, in this case min will be set as 0 and max 500. |
I see, this makes sense. Maybe not completely connected to the question above, but I found this line here
y.min: 0 or y.max: 0 I would still expect the zerobased option put the zero on the x axis level.
Do you see any reason to not add an exception for the 0 values here? In this case I would expect the zerobased option to still be working: |
The conditional stayed from the start of the project and maintained as, mainly to not break any possible issue. |
Yes, I saw this. My question was if there it would be possible to add 0 as an exception here in case The current behaviour is what i would only expect if I set |
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/
The text was updated successfully, but these errors were encountered: