Avaiga / taipy

Turns Data and AI algorithms into production-ready web applications in no time.
https://www.taipy.io
Apache License 2.0
12.4k stars 921 forks source link

y-axis labels are cut off #559

Open shoukewei opened 1 year ago

shoukewei commented 1 year ago

The longer y-axis labels are cut off, United States, United Kingdom in chart. I tried to set a margin, but nothing changed.

image

FlorianJacta commented 1 year ago

Adding a left margin in the Taipy chart should allow you to see the entire text. To do so, I created a layout dictionary to change the layout of my chart:

from taipy import Gui 

data = {
    "Temperatures": [[17.2, 27.4, 28.6, 21.5],
                     [5.6, 15.1, 20.2, 8.1],
                     [26.6, 22.8, 21.8, 24.0],
                     [22.3, 15.5, 13.4, 19.6]],
    "Countries": ["United Kingdom", "United States", "Brazil", "Germany"],
    "Seasons": ["Winter", "Spring", "Summer", "Autumn"]
}

layout = {"margin": {"l": 120}}

md = "<|{data}|chart|type=heatmap|z=Temperatures|x=Seasons|y=Countries|layout={layout}|>"

Gui(md).run()

image

Taipy version: 2.3.1

FabienLelaquais commented 10 months ago

@shoukewei Can you provide us with some code so we can reproduce this problem? The thing is: Plotly, the front-end rendering library, is in charge of all those layout details and leaves the user in charge of fine-tuning the final output. Margins should be the way to go... but you're saying it has no impact...

Thanks!

jrobinAV commented 6 months ago

@FabienLelaquais Can you add an example in the chart documentation to show how to solve this issue?

Thank you.

github-actions[bot] commented 4 months ago

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.

FabienLelaquais commented 4 months ago

I don't know if I'll do that. That would be a setting in Plotly, and there is no reason to focus on this setting and not others. I'll try to come up with a rationale for a go or a no go rapidly.

github-actions[bot] commented 3 months ago

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.

ScalarJerk commented 5 days ago

@shoukewei does this issue still persist?

FlorianJacta commented 5 days ago

Still an issue.

from taipy import Gui

data = {
    "Temperatures": [
        [17.2, 27.4, 28.6, 21.5],
        [5.6, 15.1, 20.2, 8.1],
        [26.6, 22.8, 21.8, 24.0],
        [22.3, 15.5, 13.4, 19.6],
    ],
    "Countries": ["United Kingdom", "United States", "Brazil", "Germany"],
    "Seasons": ["Winter", "Spring", "Summer", "Autumn"],
}

md = "<|{data}|chart|type=heatmap|z=Temperatures|x=Seasons|y=Countries|>"

Gui(md).run()

image