Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyecharts saveAsImage toolbox not work #33

Open
Dulou opened this issue Feb 25, 2022 · 4 comments
Open

pyecharts saveAsImage toolbox not work #33

Dulou opened this issue Feb 25, 2022 · 4 comments
Assignees

Comments

@Dulou
Copy link

Dulou commented Feb 25, 2022

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

@andfanilo andfanilo self-assigned this Feb 25, 2022
@andfanilo
Copy link
Owner

andfanilo commented Feb 25, 2022

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

@Dulou
Copy link
Author

Dulou commented Feb 28, 2022

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 )

@sudheer82
Copy link

@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

@nicedouble
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants