☰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

Empty plot by Bokeh Bar-chart

Community Support
cj9170
cj9170

I am trying to have an interactive panel, to make possible the presentation of bar charts based on the selection of an independent variable. However, my code returns empty plot, and selecting different items does not update the plot.

I also posted this question on Stackoverflow, which can be found here

⌁   Link to post
kaprisonne
kaprisonne

@cj9170 You are using categorical data on the X-Axis so you have to make the figure’s x_range be categorical as well.

Change

p = figure( plot_height = 300, title = "Inustry_code", tools=TOOLS)

to

p = figure( plot_height = 300, title = "Inustry_code", x_range=['M1', 'M2', 'M3'], tools=TOOLS)

and your plot will be properly displayed; you will probably have to manually adjust the x_range though.

More information: Handling categorical data — Bokeh 2.4.2 Documentation

PS: consider putting the link of this discourse thread to your SO post

⌁   Link to post

End of archived discussion · Replies are disabled