import panel as pn
THEME = "shine"
ECHARTS_THEMES = {
"infographic": "https://fastly.jsdelivr.net/npm/echarts/theme/infographic.js?_v_=20200710_1",
"macarons": "https://fastly.jsdelivr.net/npm/echarts/theme/macarons.js?_v_=20200710_1",
"roma": "https://fastly.jsdelivr.net/npm/echarts/theme/roma.js?_v_=20200710_1",
"shine": "https://fastly.jsdelivr.net/npm/echarts/theme/shine.js?_v_=20200710_1",
"vintage": "https://fastly.jsdelivr.net/npm/echarts/theme/vintage.js?_v_=20200710_1",
}
pn.pane.ECharts.param.theme.objects = pn.pane.ECharts.param.theme.objects + list(
ECHARTS_THEMES
)
pn.extension("echarts", js_files=ECHARTS_THEMES)
echart_bar = {
"title": {"text": "ECharts Example"},
"tooltip": {},
"legend": {"data": ["Sales"]},
"xAxis": {"data": ["shirt", "cardign", "chiffon shirt", "pants", "heels", "socks"]},
"yAxis": {},
"series": [{"name": "Sales", "type": "bar", "data": [5, 20, 36, 10, 10, 20]}],
}
plot = pn.pane.ECharts(
echart_bar,
height=500,
sizing_mode="stretch_width",
theme=THEME,
)
pn.Column(plot.param.theme, plot, sizing_mode="stretch_width").servable()