I have two charts. When I zoom in on the top or bottom chart the x-axis both update and show the same date range which is great. The problem is the y-axis on both charts is quite different so when say I zoom in on the top chart both the x & y axis's scale accordingly. On the bottom chart though the x-axis scales accordingly but the y-axis doesn't. I can't use the y_range=fig.y_range as the y ranges are very different.
Is it possible that when I zoom in on the top chart for the bottom chart's y-axis to be scaled accordingly when both charts have different y-axis ranges?
update - what I mean by accordingly
Say my x-axis goes from 1st Jan 2020 to 31st December 2020. Now say I zoom in on say on the whole of July 2020 on the top chart using the inbuilt tools, the bottom chart's x-axis adjusts accordingly automatically, i.e. the x-axis is now zoomed in on the whole of July on both charts. This work brilliantly by using the line x_range=fig.x_range. Both charts share the same x-axis.
However their y-axis are different so I can't use y_range=fig.y_range.
So what I want to do is when say I zoom in on the top chart & both the x & y axis's automatically re-scale. I want the bottom chart y-axis to also rescale (the x-axis as already mentioned do this automatically).
my code below
cds = ColumnDataSource(data=df)
fig = figure(plot_width=W_PLOT, plot_height=H_PLOT,
tools=TOOLS,
x_axis_type="datetime",
title=name,
toolbar_location='above')
# lets add a moving average
fig.line(x='time_stamp', y='ma_20', source=cds, legend_label='MA 20')
fig_ind = figure(plot_width=W_PLOT, plot_height=H_PLOT_IND,
tools=TOOLS,
x_axis_type="datetime",
x_range=fig.x_range)
fig_ind.line(x='time_stamp', y='ma_100', source=cds, legend_label='MA 100')
show(gridplot([[fig],[fig_ind]]))