4
votes

I plot a price chart. The Y-axis scale is set for the minimum and maximum price over the entire price range.

enter image description here

When I decrease the range, for example when I display the last hour, the Y axis does not scale and the same range is given. How can I do so that the Y axis automatically scales to a visible price range?

enter image description here

This is my layout

layout = go.Layout(
        title=title,
        legend=dict(orientation="h"),
        xaxis=dict(
            rangeselector=dict(
                buttons=list([
                    dict(count=1,
                         label='1h',
                         step='hour',
                         stepmode='backward'),
                    dict(count=3,
                         label='3h',
                         step='hour',
                         stepmode='backward'),
                    dict(count=6,
                         label='6h',
                         step='hour',
                         stepmode='backward'),
                    dict(count=1,
                         label='1d',
                         step='day',
                         stepmode='backward'),
                    dict(count=3,
                         label='3d',
                         step='day',
                         stepmode='backward'),
                    dict(step='all')
                ])
            ),
            rangeslider=dict(),
            type='date'
        ),
        yaxis=dict(
            title=y_axis_label,
            showticklabels= not seperate_y_axis,
            autorange=True,
            type='linear'
        )
    )
1

1 Answers

4
votes