☰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

Re-position bar segments for stacked bar plot

Community Supportbokehjs
superlazy
superlazy

Howdy,

I am working on a web application that produces horizontal stacked bar charts. I set the plot.legend.click_policy to hide, so that I can click the legend and see some categories of data toggle between hidden and visible. However, when I hide the data from one category, it just leaves blank space in the middle of the stacked bars. The behavior I am looking for is that it would re-position (or pack) all of the bars toward the vertical axis. Here is an example of what I am looking to do with bokeh: Stacked column | Highcharts.com

If it makes a difference, the server-side of my app is using bokeh.embed.json_item to export the JSON data for the plot, and the client-side is using bokehjs to embed the JSON object.

I am using version 1.4.0. I just saw that 2.0.0 was released so I gave it a try, but it appears to have the same behavior as 1.4.0.

Thanks for any help or letting me know if this is even possible!

⌁   Link to post
Bryan
Bryan

Currently the stack expression does not take glyph visibility into account. This is certainly a reasonable thing to consider have happen, but it would require new development. An appropriate first step would be for you to open a GitHub feature request issue describing what you want and providing a minimal script that you would like to have work with the new feature.

⌁   Link to post

End of archived discussion · Replies are disabled