Whisker + legend

I’m trying to create an interactive legend for a plot which contains points and error bars (via Whisker objects). However, Whiskers don’t have a legend_label attribute, so I have no idea how to connect them with their associated points, for the purposes of legend interactivity. How should I go about doing this?

Annotations (e.g. Whisker) do not currently participate in legends (interactive or otherwise). It’s probably something that could/should be improved. I’d encourage you to make an issue on GitHub with as much information as possible, e.g some minimal sample code that you would like to have work.

For the time being, the only thing I can think of is that you might be able to link visible property of the annotation to the visible property of they glyph. Either with a CustomJS callback, or possibly even a simpler js_link.

1 Like

Is the visible property of the glyph what an interactive legend manipulates (with hide, not mute)?

Yes, the "hide" click_policy toggles the visible property and the "mute" policy toggles the muted property.

1 Like