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

Echarts not working in Card #1765

Closed
MarcSkovMadsen opened this issue Nov 11, 2020 · 1 comment · Fixed by #1766
Closed

Echarts not working in Card #1765

MarcSkovMadsen opened this issue Nov 11, 2020 · 1 comment · Fixed by #1766
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@MarcSkovMadsen
Copy link
Collaborator

MarcSkovMadsen commented Nov 11, 2020

Panel 0.10.1

I would like to develop a streaming app with Echarts and other plotting libraries. In order to structure the app I would like to put the Echarts pane inside a card. But this does not work.

The problem is that when I first minimize and the maximize the card the ECharts plot is no longer shown.

screenshot

echarts_missing

Code

import numpy as np
import pandas as pd
import panel as pn
import hvplot.pandas

echarts_pane = pn.pane.ECharts(sizing_mode="stretch_both")


def update_echarts(data):
    data = pd.concat(data).reset_index()
    plot = {
        "xAxis": {
            "type": 'category',
            "data": list(data.index.values)
        },
        "yAxis": {
            "type": 'value'
        },
        "series": [{
            "data": list(data["y"]),
            "type": 'line',
            "showSymbol": False,
            "hoverAnimation": False,
        },
        ],
        "responsive": True
    }
    echarts_pane.object = plot

def emit(*args):
    data=[pd.DataFrame({"y": [np.random.randn()]}, index=pd.DatetimeIndex([pd.datetime.now()])) for i in range(0,50)]
    update_echarts(data)
emit()

emit_button = pn.widgets.Button(name="EMIT")
emit_button.on_click(emit)
layout = pn.layout.Card(echarts_pane, header="ECHARTS", sizing_mode="stretch_both")
layout.servable()
@MarcSkovMadsen MarcSkovMadsen added the TRIAGE Default label for untriaged issues label Nov 11, 2020
@philippjfr philippjfr added type: bug Something isn't correct or isn't working and removed TRIAGE Default label for untriaged issues labels Nov 11, 2020
@philippjfr philippjfr added this to the v0.10.2 milestone Nov 11, 2020
@adiladawi
Copy link

i believe im having the same issue
the chart disappears and the card doesnt collapse

and when chart is showing, the position of the chart is at the bottom of the card and it doesnt confine itself within the area of the card

the same goes for other layouts too (Row, Column)

VID_20210318_040741.mp4

Panel 0.11.1 , React Template

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants