Hi,
I think I might have asked this question before. I added the legend.click_policy as hide in the example below. If the user wants to hide one of the legend items. Not entirely sure if this was possible for circle method. Is there a way to be able to do it for p.circle of I might need to create a glyph?
Can anyone direct me to an example?
from bokeh.io import show
from bokeh.models import ColumnDataSource
from bokeh.palettes import RdBu3
from bokeh.plotting import figure
c1 = RdBu3[2] # red
c2 = RdBu3[0] # blue
source = ColumnDataSource(dict(
x=[1, 2, 3, 4, 5, 6],
y=[2, 1, 2, 1, 2, 1],
color=[c1, c2, c1, c2, c1, c2],
label=['hi', 'lo', 'hi', 'lo', 'hi', 'lo']
))
p = figure(x_range=(0, 7), y_range=(0, 3), height=300, tools='save')
# legend field matches the column in the source
p.circle( x='x', y='y', radius=0.5, color='color', legend_group='label', source=source)
p.legend.click_policy="hide"
show(p)