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

EChart not shown every other time I change a parameter #1817

Closed
MarcSkovMadsen opened this issue Nov 27, 2020 · 0 comments · Fixed by #4452
Closed

EChart not shown every other time I change a parameter #1817

MarcSkovMadsen opened this issue Nov 27, 2020 · 0 comments · Fixed by #4452

Comments

@MarcSkovMadsen
Copy link
Collaborator

Panel 0.10.2
Bokeh 2.2.3

I'm trying to style the Panel components in the Fast.design style and would like to create an app show casing all the Panel components using this style. This includes the possibility to change the component parameters.

For the ECharts pane I observe a strange behavior. Every second time I change either the renderer or theme parameter the ECharts plot is not shown.

echarts_not_shown

import panel as pn

pn.extension("echarts")

ACCENT_REST = "#DF3874"


def _create_echarts_plot():
    echart = {
        "tooltip": {},
        "legend": {"data": ["Sales"]},
        "xAxis": {
            "data": ["shirt", "cardign", "chiffon shirt", "pants", "heels", "socks"],
            "axisLine": {"lineStyle": {"color": "#ccc"}},
        },
        "yAxis": {
            "axisLine": {"lineStyle": {"color": "#ccc"}},
        },
        "series": [
            {
                "name": "Sales",
                "type": "bar",
                "data": [
                    1.0,
                    1.2,
                    1.4,
                    1.6,
                    1.8,
                    2.0,
                ],
                "itemStyle": {"color": "#DF3874"},
            }
        ],
        "responsive": True,
    }
    text_style = {"color": "#ccc"}
    update = ["legend", "xAxis", "yAxis"]
    for upd in update:
        echart[upd]["textStyle"] = text_style
    return echart


pn.config.sizing_mode = "stretch_width"
component = pn.pane.ECharts(
                _create_echarts_plot(), min_height=400, min_width=200, sizing_mode="stretch_both"
            )
controls = component.controls()
pn.Column(
    component, controls
).servable()
@MarcSkovMadsen MarcSkovMadsen added the TRIAGE Default label for untriaged issues label Nov 27, 2020
@philippjfr philippjfr added type: bug and removed TRIAGE Default label for untriaged issues labels Nov 30, 2020
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

Successfully merging a pull request may close this issue.

2 participants