Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

I use flet plotly to draw the graph, and the same piece of code sometimes shows the graph and sometimes not #4579

Closed
1 task done
1ajie1 opened this issue Dec 16, 2024 · 0 comments

Comments

@1ajie1
Copy link

1ajie1 commented Dec 16, 2024

Duplicate Check

Describe the bug

屏幕截图 2024-12-16 234639

Code sample

Code
import plotly.express as px
import pandas as pd
import flet as ft
from flet.plotly_chart import PlotlyChart

def main(page: ft.Page):

    # def add_chart(e):
    #     charts_list.controls.append(PlotlyChart(fig, expand=True))
    #     print(len(charts_list.controls))
        # page.update()
    df = pd.DataFrame({
        'time': [1990, 1997, 2003, 2009],
        "cpu_usage": [20, 30, 25, 35],
    })
    fig = px.line(df, x="time", y="cpu_usage")

    charts_list = ft.ListView(expand=1, spacing=10, padding=20, auto_scroll=True)
    charts_list.controls.append(PlotlyChart(fig, expand=True))
    charts_list.controls.append(PlotlyChart(fig, expand=True))
    charts_list.controls.append(PlotlyChart(fig, expand=True))
    page.add(charts_list)
    page.update()

ft.app(target=main)

To reproduce

运行命令:flet.exe run --web --port 8888 .\tmp\tmp1.py -d

Expected behavior

No response

Screenshots / Videos

Captures

[Upload media here]

Operating System

Windows

Operating system details

windows 11

Flet version

0.25.1

Regression

I'm not sure / I don't know

Suggestions

No response

Logs

Logs
 warnings.warn("remove second argument of ws_handler", DeprecationWarning)
D:\python\miniconda\envs\flet-learn\Lib\site-packages\kaleido\scopes\base.py:188: DeprecationWarning:

setDaemon() is deprecated, set the daemon attribute instead

D:\python\miniconda\envs\flet-learn\Lib\site-packages\websockets\legacy\server.py:1177: DeprecationWarning:

remove second argument of ws_handler

Additional details

No response

@FeodorFitsner FeodorFitsner changed the title 我使用flet plotly 画图,同一段代码有时能显示出图表有时不能 I use flet plotly to draw the graph, and the same piece of code sometimes shows the graph and sometimes not Dec 16, 2024
@flet-dev flet-dev locked and limited conversation to collaborators Dec 16, 2024
@FeodorFitsner FeodorFitsner converted this issue into discussion #4585 Dec 16, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant