☰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

Icon save png -> html

Community Support
odadoun
odadoun

Hi,

is there a way to modify the output format of the save icon button to
retrieve my chart in html ?
Or eventually add a new button to implement this functionality ?
Thanks
Olivier

⌁   Link to post
Bryan
Bryan

Hi @odadoun the short answer is no, since all the SaveTool does is convert the HTML raster canvas for one plot in to a PNG. But it’s not really clear what exactly you are hoping to be accomplish (I can think of at least a half a dozen clarifying questions about what “save my chart to HTML” might mean, specifically). Perhaps you can describe your actual requirements and what you’d like to see possible in more detail.

⌁   Link to post
odadoun
odadoun

Thanks.
I need a html format file to be able to display my chart inside a web page.
Basically I need have a button to the following stuff:

from bokeh.plotting import output_file
output_file("test.html")
save(fig)

Do you think is manageable ? :face_with_monocle:
Olivier

⌁   Link to post
Bryan
Bryan

Your use case is still unclear. You press a “save to HTML” button, are you trying to save the entire current page? Or just “a single plot”? If is the former, that maybe seems doable, and there are probably answers on Stack Overflow with JS you could put in a CustomJS callback for a Button. If it is the latter, that seems much harder. You would need to construct, in JavaScript, an completely new page that includes all the BokehJS resource loading, and also just the subset of the page you want to save. I’m not sure how that would work.

⌁   Link to post
Bryan
Bryan

I’m afraid I don’t have any specific advice to offer beyond the brief plausible outline I gave above. It’s a difficult problem, and not one I can devote time to at present.

⌁   Link to post

End of archived discussion · Replies are disabled