
I am attempting to get hover to work correctly with a graph that has a second y-axis. Currently, hover works fine with just 1 y-axis such as:
p = figure(x_axis_type=“datetime”, x_axis_label=x_axis_label, y_axis_label=y_axis_label, y_range=y_range, sizing_mode=“stretch_width”, output_backend=“webgl”)
p.add_tools(HoverTool(tooltips=[(‘Item’, ‘$name’),
(‘Time’, ‘$x{%Y-%m-%d %H:%M:%S}’),
(‘Voltage’, hov’$y{%1.1f} Volts’),
],
p.line(x, y, color=c, legend_label=‘label’, name=‘name’)
I’m adding data on a second y-axis with something like this:
p.extra_y_ranges = {“y2”: Range1d(start=bottom, end=top)}
p.add_layout(LinearAxis(y_range_name=“y2”, axis_label=‘Percent Disolved Oxygen’), ‘right’)
p.line(data[‘tstamp’], disolved_oxygen, legend=‘Disolved Ocygen %’, color = “cyan”, y_range_name = “y2”)
The hover tool does hovering on both data in the 1st y-axis (correctly), and also the second y-axis (but incorrectly).
Any thoughts on how to do this?


