Skip to content

PlotlyChart #3746

Closed
Closed

Description

@mogeebqaid

Duplicate Check

Describe the requested feature

I tried using the Plotly chart, but it seems that the interactivity feature is not working.
Can this issue be solved to make it possible to fully integrate Plotly with flet?

Code example to reproduce the issue:

import plotly.graph_objects as go
import plotly.express as px
import pandas as pd
import flet as ft
from flet.plotly_chart import PlotlyChart
from flet import WebView

def main(page: ft.Page):
    df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')

    fig = px.line(df, x='Date', y='AAPL.High', title='Time Series with Range Slider and Selectors')

    fig.update_xaxes(
        rangeslider_visible=True,
        rangeselector=dict(
            buttons=list([
                dict(count=1, label="1m", step="month", stepmode="backward"),
                dict(count=6, label="6m", step="month", stepmode="backward"),
                dict(count=1, label="YTD", step="year", stepmode="todate"),
                dict(count=1, label="1y", step="year", stepmode="backward"),
                dict(step="all")
            ])
        )
    )
    page.add(PlotlyChart(fig, expand=True))

ft.app(main)

Suggest a solution

No response

Screenshots

No response

Additional details

No response

Activity

  1. ndonkoHenri commented on Jul 31, 2024

    @ndonkoHenri
    Contributor

    Matplotlib and Plotly charts are static in Flet. Internally, they just render the provided figures as images.
    For interactive charts atm, see other chart types we have: https://flet.dev/docs/controls/charts

  2. locked and limited conversation to collaborators on Jul 31, 2024
  3. converted this issue into a discussion #3747 on Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions