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

[🐛 BUG] Dynamic chart title does not work #2371

Open
1 of 7 tasks
AlexandreSajus opened this issue Dec 26, 2024 · 0 comments
Open
1 of 7 tasks

[🐛 BUG] Dynamic chart title does not work #2371

AlexandreSajus opened this issue Dec 26, 2024 · 0 comments
Labels
🖰 GUI Related to GUI 💥Malfunction Addresses an identified problem. 🟧 Priority: High Must be addressed as soon

Comments

@AlexandreSajus
Copy link
Contributor

AlexandreSajus commented Dec 26, 2024

What went wrong? 🤔

Updating dynamically the title property of a chart visual element does not work. Here is an example where I try to change the title of a chart using a button. Pressing the button should change the title but does nothing.

import pandas as pd

import taipy.gui.builder as tgb
from taipy.gui import Gui

data = pd.DataFrame({"Product": ["Shovel", "Rake", "Hoe"], "Price": [10, 5, 7]})

title = "Undefined"


def update_title(state):
    state.title = "Price of Gardening Tools"


with tgb.Page() as page:
    tgb.button("Update Title", on_action=update_title)
    tgb.chart(data="{data}", title="{title}")

Gui(page).run()

Using layout is a workaround:

import pandas as pd

import taipy.gui.builder as tgb
from taipy.gui import Gui

data = pd.DataFrame({"Product": ["Shovel", "Rake", "Hoe"], "Price": [10, 5, 7]})

layout = {"title": "Undefined"}


def update_title(state):
    state.layout = {"title": "Price of Gardening Tools"}


with tgb.Page() as page:
    tgb.button("Update Title", on_action=update_title)
    tgb.chart(data="{data}", layout="{layout}")

Gui(page).run()

image

Runtime Environment

Windows 11

Browsers

Chrome

OS

Windows

Version of Taipy

4.0.2

Acceptance Criteria

  • A unit test reproducing the bug is added.
  • Any new code is covered by a unit tested.
  • Check code coverage is at least 90%.
  • The bug reporter validated the fix.
  • Related issue(s) in taipy-doc are created for documentation and Release Notes are updated.

Code of Conduct

  • I have checked the existing issues.
  • I am willing to work on this issue (optional)
@AlexandreSajus AlexandreSajus added 🖰 GUI Related to GUI 💥Malfunction Addresses an identified problem. 🟧 Priority: High Must be addressed as soon labels Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖰 GUI Related to GUI 💥Malfunction Addresses an identified problem. 🟧 Priority: High Must be addressed as soon
Projects
None yet
Development

No branches or pull requests

1 participant