Skip to content

Pie chart - selected parameter - On click on pie chart slice, data on below bar chart are changing but I am able to see same function is called multiple times #2485

Discussion options

You must be logged in to vote

Your on_change is called whenever a variable is being changed through the User Interface or when you do: state.xxx = .

You must add an if statement to this callback in order to do the function only when you need it:

def on_change(state: State, var_name: str, var_value):
    if var_name == "selected": # or var_name  in ["selected", ...] depending on what the logic of your app is
        ...

Replies: 1 comment 1 reply

Comment options

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

Answer selected by rajarajan08p213
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
🖰 GUI Related to GUI ❓ Question Can be unblocked with an answer
2 participants