You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have a chart with 2 or more y-axis with differing min/max & minValue/maxValue
Toggle first y-axis off in legend
y-axis datazoom doesn't update min/max labels.
Current Behavior
Datazoom with >2 y-axis doesn't account for both axes, it always defaults to the first. The values don't update when first axis is toggled, currently they get reset to NaN.
Expected Behavior
The min/max value should be global for all y-axis when both are included in yAxis array of dataZoom. Datazoom labels should update when first y-axis is toggled.
This code will work as expected with feature.dataZoom.
But you'll lose the regular dataZoom. And be aware of this bug #20265 when selecting too narrow X area.
actually for me step 3 does not reproduce.
There is one visible blue y-axis that do update values dynamically thru dataZoom slider, as expected.
BTW two grids are not necessary, one is sufficient.
The axis is fine but the handle labels on the dataZoom do not update when the first entry of the legend is toggled off for me still. The dataZoom functions correctly with clipping the axis/data but doesn't update its handle labels/details. Internally the min/max & minValue/maxValue of the dataZoom do not update correctly when the legend toggles, not the axis (this works as expected). A temporary workaround I have is adjusting the yAxisIndex of the array when the legend is toggled by binding to the "legendselectchanged" event and manually updating it myself, though this feels like it should be the default behavior.
Related, the dataZoom min/max (again not the axes, just the zoom) do not correctly account for the min/max of all axes listed in the yAxisIndex array, it seems to default to the first index.
handle labels on the dataZoom do not update when the first entry of the legend is toggled off
Aah, your code does not have handleLabel, that's why I did not understand.
Now I see the problem and your workaround - Demo. It could be considered a bug, I added it to the list in #20392.
Activity
helgasoft commentedon Feb 25, 2025
This code will work as expected with feature.dataZoom.
But you'll lose the regular dataZoom. And be aware of this bug #20265 when selecting too narrow X area.
tking5 commentedon Feb 25, 2025
Sure, but the slider dataZoom issue still remains.
helgasoft commentedon Feb 26, 2025
actually for me step 3 does not reproduce.
There is one visible blue y-axis that do update values dynamically thru dataZoom slider, as expected.
BTW two grids are not necessary, one is sufficient.
tking5 commentedon Feb 26, 2025
The axis is fine but the handle labels on the dataZoom do not update when the first entry of the legend is toggled off for me still. The dataZoom functions correctly with clipping the axis/data but doesn't update its handle labels/details. Internally the min/max & minValue/maxValue of the dataZoom do not update correctly when the legend toggles, not the axis (this works as expected). A temporary workaround I have is adjusting the yAxisIndex of the array when the legend is toggled by binding to the "legendselectchanged" event and manually updating it myself, though this feels like it should be the default behavior.
Related, the dataZoom min/max (again not the axes, just the zoom) do not correctly account for the min/max of all axes listed in the yAxisIndex array, it seems to default to the first index.
helgasoft commentedon Feb 26, 2025
Aah, your code does not have handleLabel, that's why I did not understand.
Now I see the problem and your workaround - Demo. It could be considered a bug, I added it to the list in #20392.