Skip to content
Discussion options

You must be logged in to vote

The min and max properties for the metric control are not dynamic, so they will retain the value at initialization.

The easiest solution might be to instead use a figure directly like so:

import pandas as pd
import plotly.graph_objects as go
from taipy.gui import Gui, State

df = pd.DataFrame({"product": ["A", "B", "C"], "sales": [100, 200, 150]})

product_list = df["product"].tolist()
selected_product = None
sales_figure = None


def update_sales(state):
    _total_sales = df[df["product"] == state.selected_product]["sales"].values[0]
    _min_sales = _total_sales - 50
    _max_sales = _total_sales + 50
    _threshold_sales = _total_sales + 20

    fig = go.Figure(
        go.Indicator(
…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@fpinedevx
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by arcanaxion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants