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

Chart Height is constant even when setting its height with in initOpts

Open avivazran opened this issue 3 years ago • 1 comments

charts are outputted in streamlit app in constant size which makes them sometimes unreadable.

c = Line(init_opts=opts.InitOpts(theme=ThemeType.DARK, height='1600px', width='1600px'))

image

unlike the stock visualization components of streamlit, the echarts components doesn't have the 'extend' button which the other components have and enables full screen view of the chart.

I know that this probably a streamlit related issue rather than to this package, however - if there is a way to force the chart height or at least add a full screen view option that will be great.

Thanks

avivazran avatar Dec 23 '21 07:12 avivazran

Hello @avivazran !

Unfortunately the Pyecharts InitOpts don't seem to be passed as options to echarts, so theme=ThemeType.DARK, height='1600px', width='1600px' need to be passed at the st_pyecharts call instead to be used.


c = (
    Line()
    .add_xaxis(Faker.choose())
    .add_yaxis("商家A", Faker.values())
    .add_yaxis("商家B", Faker.values())
)
st_pyecharts(c, theme=ThemeType.DARK, height="1600px", width="1600px")

I'm also looking into an issue on resizing the chart for responsive design for #27 and #28.

Have a nice day, Fanilo

andfanilo avatar Dec 23 '21 10:12 andfanilo