☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

callback from a CheckboxGroup to toggle between line and scatter methods

Community Support
Patrick_Brockmann
Patrick_Brockmann

Hi,

I would like to add a checkbox to my bokeh interface to toggle between line and scatter methods.

I have try this following code but the CheckboxGroup does not have any callback argument.

from bokeh.plotting import figure
from bokeh.io import vform, show
from bokeh.models import CustomJS, ColumnDataSource
from bokeh.models.widgets import CheckboxGroup

x = [x*0.005 for x in range(0, 20)]
y = x

source = ColumnDataSource(data=dict(x=x, y=y))

plot = figure(plot_width=400, plot_height=400)

plot.line(‘x’, ‘y’, source=source, line_width=3, line_alpha=0.6)
plot.scatter(‘x’, ‘y’, source=source, line_width=3, line_alpha=0.6)

checkbox_group = CheckboxGroup(
labels=[“Scatter”], active=[0])

layout = vform(checkbox_group, plot)

show(layout)

Any idea ?

Thanks
Patrick

⌁   Link to post
Patrick_Brockmann
Patrick_Brockmann

There is an issue on that.

So should be soon be possible.

Patrick

⌁   Link to post

End of archived discussion · Replies are disabled