# Icon save png -\> html

**URL:** <https://discourse.bokeh.org/t/icon-save-png-html/8471>\
**Category:** Community Support\
**Created:** [October 6, 2021, 4:39pm UTC](https://discourse.bokeh.org/t/icon-save-png-html/8471 "2021-10-06T16:39:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![odadoun](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/odadoun/32/2007_2.png) [@odadoun](https://discourse.bokeh.org/u/odadoun)\
**Post date:** [October 6, 2021, 4:39pm UTC](https://discourse.bokeh.org/t/icon-save-png-html/8471/1 "2021-10-06T16:39:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Bryan](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/bryan/32/3625_2.png) [@Bryan](https://discourse.bokeh.org/u/Bryan)\
**Post date:** [October 6, 2021, 4:55pm UTC](https://discourse.bokeh.org/t/icon-save-png-html/8471/2 "2021-10-06T16:55:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![odadoun](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/odadoun/32/2007_2.png) [@odadoun](https://discourse.bokeh.org/u/odadoun)\
**Post date:** [October 6, 2021, 5:22pm UTC](https://discourse.bokeh.org/t/icon-save-png-html/8471/3 "2021-10-06T17:22:19Z")

</div>

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:

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

```

Do you think is manageable ? 🧐  
Olivier

---

<div class="post-metadata">

**Author:** ![Bryan](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/bryan/32/3625_2.png) [@Bryan](https://discourse.bokeh.org/u/Bryan)\
**Post date:** [October 6, 2021, 6:07pm UTC](https://discourse.bokeh.org/t/icon-save-png-html/8471/4 "2021-10-06T18:07:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![odadoun](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/odadoun/32/2007_2.png) [@odadoun](https://discourse.bokeh.org/u/odadoun)\
**Post date:** [October 6, 2021, 7:46pm UTC](https://discourse.bokeh.org/t/icon-save-png-html/8471/5 "2021-10-06T19:46:13Z")

</div>

I would like to save a single html plot (so the harder one 🤐).  
For instance the first plot presented here:

> **[\[“PyCoa - version v2”\]](https://www.pycoa.fr/)**
>
> \[“A Python Covid Analysis toolkit - nov. 2020 / oct. 2021”\]

and all the other plots (to have access to the corresponding html you need to click on the png figure)  
Thanks

---

<div class="post-metadata">

**Author:** ![Bryan](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/bryan/32/3625_2.png) [@Bryan](https://discourse.bokeh.org/u/Bryan)\
**Post date:** [October 6, 2021, 7:49pm UTC](https://discourse.bokeh.org/t/icon-save-png-html/8471/6 "2021-10-06T19:49:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads.bokeh.org/original/2X/1/14eb24f9e10e4e9b78e3f10f66c04ffa96446e5a.svg) [@system](https://discourse.bokeh.org/u/system)\
**Post date:** [January 4, 2022, 7:49pm UTC](https://discourse.bokeh.org/t/icon-save-png-html/8471/7 "2022-01-04T19:49:39Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
