Skip to content

[Bug] Server Side Rendering - Legend spacing does not increase when legend font size does #17326

@ArturCapraro

Description

@ArturCapraro

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.

Metadata

Metadata

Assignees

Labels

SSRServer Side RenderingbugenThis issue is in English

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions