Open Switchbot-Nova opened 1 year ago
The sync
tickmode option has been fully released as a native configuration option within Plotly.js https://github.com/plotly/plotly.js/releases/tag/v2.18.0
Are you able to update to v2.18.0
of Plotly to try to implement this natively? If so, I'd be curious to know if the new feature is intuitive enough for you to implement without aid, but if you upgrade and need some assistance in implementing it, I'd be happy to assist!
Hi,
Ive tried implementing tickmode sync before which works for the gridlines but the axes do not get aligned at 0, see screenshot
I'll explore this within the next few days! Thanks for letting me know!
I noticed that the tickmode='sync'
option in Plotly is not exactly doing what your original code was intended to do, namely: make both y axes use the same grid lines, make sure the traces use the same grid line at y = 0 (also when traces can have negative values), and make sure that the tick labels of the second y axis have nice round numbered values instead of these very odd decimal numbers.
When I select an area to zoom in on it works but then after double clicking to zoom back out the gridlines reset to what they were before implementing this solution.