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 · 14 comments
Open
1 of 7 tasks

Chart title property should be dynamic #2371

AlexandreSajus opened this issue Dec 26, 2024 · 14 comments
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
@ChamaliVishmani
Copy link

Hi is anyone working on this issue? If not, can I start working on this?

@FlorianJacta
Copy link
Member

Yes, sure! If you need any help, please ask to our R&D @FabienLelaquais and @FredLL-Avaiga !

@ChamaliVishmani
Copy link

Okay, thanks !

@ADORA-ATAYA
Copy link

Hi is anyone working on this issue? If not, can I start working on this?

@FlorianJacta
Copy link
Member

Maybe, @ChamaliVishmani is already traying to solve the issue but you can be assigned as well @ADORA-ATAYA

@ADORA-ATAYA
Copy link

thanks

@ChamaliVishmani
Copy link

Hi @FlorianJacta, I'm still working on this issue. I attempted to use useState to handle the title prop, as the issue seems to be related to its immutability. I also explored other approaches, including modifying the prop directly, but haven't found a working solution yet.

Could you provide some guidance on debugging and potential ways to fix this? Any suggestions would be greatly appreciated!

@ChamaliVishmani
Copy link

ChamaliVishmani commented Feb 11, 2025

Hi, @ADORA-ATAYA I’d be happy to collaborate if you’d like to help.

@ADORA-ATAYA
Copy link

Sure @ChamaliVishmani, I am happy to collaborate with you

@FlorianJacta
Copy link
Member

@FabienLelaquais or @FredLL-Avaiga, could you provide some guidance to @ChamaliVishmani for this issue?

Copy link
Contributor

This issue has been labelled as "🥶Waiting for contributor" because it has been inactive for more than 14 days. If you would like to continue working on this issue, please add another comment or create a PR that links to this issue. If a PR has already been created which refers to this issue, then you should explicitly mention this issue in the relevant PR. Otherwise, you will be unassigned in 14 days. For more information please refer to the contributing guidelines.

@github-actions github-actions bot added the 🥶Waiting for contributor Issues or PRs waiting for a long time label Feb 26, 2025
Copy link
Contributor

This issue has been unassigned automatically because it has been marked as "🥶Waiting for contributor" for more than 14 days with no activity.

@github-actions github-actions bot removed the 🥶Waiting for contributor Issues or PRs waiting for a long time label Mar 13, 2025
@FredLL-Avaiga
Copy link
Member

@FabienLelaquais or @FredLL-Avaiga, could you provide some guidance to @ChamaliVishmani for this issue?

The property type should be changed to PropertyType.dynamic_string in factory.py

Then on the front-end side, the attribute has to be managed as other Dynamic string properties.

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

6 participants