clone y-domain for y2 and y2-domain for y if there is no data target
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.4k
- Avg merge
- 6d 16h
- Merged PRs (30d)
- 1
Description
Hi,
there are user who want to have both axes showing the same data. One option would be to use max and min for axes to copy the scale of one axis but the calculation of min and max with the padding is not easy and in many situations there are no animations after static values are given.
So, i have made an enchanchement that clones the other axis-domain if there is no target. Look at the screenshoots

this one is if all data_values are given to y-axis. if i decide to show y2-axis it scales from 0 to 1 as standard. in this case i copy the domain from y-axis to get a scaling that is maybe more useful

if both axes have their targets the bahaviour is the same

if i hide all data_values of y-axis there are no targets left and so y-axis copies the domain from y2-axis

if i hide all data_values of y2-axis there are no targets left and so y2-axis copies the domain from y-axis
one point is that it could be confusing for case 3 and 4. but if you use two axes you should be prepared for confusion.
my question is, is anyone interested in this enchanchment (is it an enchanchment ?) ?
this is only one line code change so I would make a pull request for it
Contributor guide
Assessment
This issue has not been assessed yet.