
I am building a plot with two y-axes and customJS for an standalone document.
I need to have both axes to change with the selections from two drop down menus.
The left y-axis changes if I do not set the y-range in the vbar, but the other (a scattered plot) does not let me leave y-range empty. Therefore it does not changes when selected another option in menu
I have this:
comp_bar = figure(x_range = states, plot_width = 700, plot_height = 400 , tools = ['box_zoom, pan, save, reset, wheel_zoom'])
comp_bar.vbar(x = dodge('x', 0, range = comp_bar.x_range), top = 'y', width = 1, source = source, alpha = 1, color = 'darkviolet', bottom=10)
y_column_ext_range = 'new_axis'
max_ext_accts = comp_data.y.max()
comp_bar.extra_y_ranges = {y_column_ext_range: Range1d(start = 0,end = max_ext_accts, bounds=('auto'))}
comp_bar.add_layout(LinearAxis(y_range_name = 'new_axis', axis_label = 'Competitor'), 'right')
comp_bar.scatter('x', 'y', legend = 'Competitor2', line_width = 1, y_range_name = y_column_ext_range,
color = 'blue', source = source )
customJS1 = JS CODE
customJS2 = JS CODE
ext_drop_menu = Select(title="date", value = months_[0], options = months_, callback = customJS1, width = 200)
com_drop_menu = Select(title="Competitor:", value = 'customer1', options = customers, callback = customJS2, width = 200)
show(comp_bar, com_drop_menu, ext_drop_menu)
Thanks,

