Autoscale Y axis on Double Click for data in-view

Hey all!

So I’ve been doing quite a bit of work with multiple-axes charts, but what I find to be the most annoying component of my implementation is that I’m unaware of a good way to rescale the axes based on the current data within the zoom range. When you double click on a given axis, the axis is rescaled based on the entire range of data, so on shorter time horizons, I find that my charts end up just being horizontal lines, which is not especially useful. I figure that this is probably a common enough problem that I would toss it out to people to see if you have any solutions for this issue?


You could make a button, or whatever other input, that sends to a callback that updates the layout of the figure.
something like this:

yaxis={‘range’:[y_view_low, y_view_high}}

You could write a custom function to automatically set the values for the 2 y_view paramaters. I’ve done this for automically scaling candlesticks charts based on the rowSelected input from an AGGrid. Look through the documentation to see what other parameters you can tweak for fig.update_layout.