Open FlorianJacta opened 1 month ago
Hello @FlorianJacta :)
I think 150 and 150px are two different units. It is related to this issue too: https://github.com/Avaiga/taipy/issues/2142 so you should also be assigned there
Parameters in the 'metric' component do not accept units like, px or rem. Use numerical values without units (e.g. width=150, height=300). This should apply the desired dimensions to the metric component.
The issue lies in how you're setting the width and height properties in the metric widget.
Taipy GUI uses a specific syntax for styling, and width and height should be defined within a style attribute.
Try modifying your page string as follows:
page = """ <|{value}|metric|style={"width": "300px", "height": "300px"}|> """
Or, for multiple styles:
page = """ <|{value}|metric|style={"width": "300px", "height": "300px", "font-size": "24px"}|> """
This should correctly apply the width and height styles to your metric widget.
Additionally, consider using units like px for pixels or % for percentage-based sizing.
For more information on Taipy GUI styling, refer to the official documentation:
@Yubarajhalder your answer is not answering the issue
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.
This issue has been unassigned automatically because it has been marked as "🥶Waiting for contributor" for more than 14 days with no activity.
What went wrong? 🤔
Setting width and height for metrics with CSS units is not working. This won't change the width/height as expected.
This works when just putting a number. It took a while for me to figure out (I went looking at the actual PR).
If this issue could be backported to another patch, this would be great.
Expected Behavior
This should work with all CSS units supported by Taipy. Or the documentation should change to reflect this behavior.
Steps to Reproduce Issue
Screenshots
Version of Taipy
4.0
Acceptance Criteria
Code of Conduct