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] Server Side Rendering - Legend spacing does not increase when legend font size does #17326

Closed
ArturCapraro opened this issue Jul 6, 2022 · 1 comment · Fixed by ecomfe/zrender#968
Assignees
Labels
bug en This issue is in English SSR Server Side Rendering
Milestone

Comments

@ArturCapraro
Copy link

ArturCapraro commented Jul 6, 2022

Version

5.3.3

Link to Minimal Reproduction

No response

Steps to Reproduce

Increase the legend font size and try to create an svg with server side rendering.

Current Behavior

When we get the server side rendered image with the default font size, the image show fine:

"legend": {
    "type": "plain",
    "orient": "horizontal",
    "left": 60,
    "bottom": 10,
    "icon": "roundRect",
    "selectedMode": false,
    "itemGap": 20,
    "data": [
        "this is element 1",
        "this is element 2",
        "this is element 3",
        "other elements",
        "other elements",
        "other elements"
    ]
},

demo_regular

But, if we increase the fontsize, the gaps between legent items does not increase, causing elements everlap:

"legend": {
    "type": "plain",
    "orient": "horizontal",
    "left": 60,
    "bottom": 10,
    "icon": "roundRect",
    "selectedMode": false,
    "itemGap": 20,
    "textStyle": { "fontSize": 15 },
    "data": [
        "this is element 1",
        "this is element 2",
        "this is element 3",
        "other elements",
        "other elements",
        "other elements"
    ]
},

The only difference here from the beginning is "textStyle": { "fontSize": 15 },.
demo_increasing_fontsize

Expected Behavior

Expect a correct spacing between elements in legend when fontsize increase avoiding overlap.

Environment

- OS: Ubuntu 20.04.4 LTS
- Browser: Chrome
- Node.js: v18.1.0

Any additional comments?

This only occurs with server side generating. In the front-end with javascript and the same options the charts are generating correctly even with font-size increase.

@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Jul 6, 2022
@davidjr82
Copy link

I can confirm this issue is happening.

The font-size is not taken into account when generating SSR svg files following the instructions in docs.

https://echarts.apache.org/handbook/en/how-to/cross-platform/server

@plainheart plainheart added SSR Server Side Rendering and removed pending We are not sure about whether this is a bug/new feature. labels Oct 24, 2022
@plainheart plainheart added this to the 5.4.1 milestone Oct 24, 2022
@plainheart plainheart self-assigned this Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English SSR Server Side Rendering
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants