streamlit-echarts icon indicating copy to clipboard operation
streamlit-echarts copied to clipboard

pyecharts saveAsImage toolbox not work

Open Dulou opened this issue 2 years ago • 4 comments

I add a saveAsImage button to pyecharts, which works in HTML render but not works in streamlit-pyecharts

Dulou avatar Feb 25 '22 07:02 Dulou

Hi @Dulou ! Do you have a code snippet I can reuse to test on my side? Thanks again! Fanilo

andfanilo avatar Feb 25 '22 08:02 andfanilo

Sorry to reply late.

I just use the pyecharts example in the readme

from pyecharts import options as opts
from pyecharts.charts import Bar
from streamlit_echarts import st_pyecharts

b = (
    Bar()
    .add_xaxis(["Microsoft", "Amazon", "IBM", "Oracle", "Google", "Alibaba"])
    .add_yaxis(
        "2017-2018 Revenue in (billion $)", [21.2, 20.4, 10.3, 6.08, 4, 2.2]
    )
    .set_global_opts(
        title_opts=opts.TitleOpts(
            title="Top cloud providers 2018", subtitle="2017-2018 Revenue"
        ),
        toolbox_opts=opts.ToolboxOpts(),
    )
)
st_pyecharts(b)

After I use the saveAsImage button, the toolbox will disappear and no image is saved as below image

More information: Edge Brower ( Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 Edg/98.0.1108.55 )

Dulou avatar Feb 28 '22 00:02 Dulou

@andfanilo - i can confirm this issue. toolbox disappears when save image is selected. Does this have to do anything with streamlit security?

pyecharts when rendered in jupyter using render_notebook(), the save image option of toolbar works. So this issue is specific to not related to pyecharts

Note: All other options of toolbox are working well without an issue except save image

sudheer82 avatar Nov 23 '22 18:11 sudheer82

+1

nicedouble avatar Apr 21 '23 13:04 nicedouble