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

Chart title property should be dynamic #2371

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

Chart title property should be dynamic #2371

AlexandreSajus opened this issue Dec 26, 2024 · 1 comment
Labels
good first issue New-contributor friendly 🖰 GUI Related to GUI 📈 Improvement Improvement of a feature. 🟧 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
@jrobinAV
Copy link
Member

I believe this is not a malfunction but an improvement as the property is probably not dynamic.

@jrobinAV jrobinAV added 📈 Improvement Improvement of a feature. and removed 💥Malfunction Addresses an identified problem. labels Jan 10, 2025
@jrobinAV jrobinAV changed the title [🐛 BUG] Dynamic chart title does not work [Improvement] Dynamic chart title does not work Jan 10, 2025
@jrobinAV jrobinAV changed the title [Improvement] Dynamic chart title does not work [Improvement] Dynamic chart title should be dynamic Jan 10, 2025
@jrobinAV jrobinAV added the good first issue New-contributor friendly label Jan 10, 2025
@jrobinAV jrobinAV changed the title [Improvement] Dynamic chart title should be dynamic [Improvement] chart title property should be dynamic Jan 10, 2025
@jrobinAV jrobinAV changed the title [Improvement] chart title property should be dynamic Chart title property should be dynamic Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue New-contributor friendly 🖰 GUI Related to GUI 📈 Improvement Improvement of a feature. 🟧 Priority: High Must be addressed as soon
Projects
None yet
Development

No branches or pull requests

2 participants