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

[FEATURE] Apply box width when using point style in legend labels #5665

Open
Lenophie opened this issue Aug 6, 2018 · 3 comments · May be fixed by #9532
Open

[FEATURE] Apply box width when using point style in legend labels #5665

Lenophie opened this issue Aug 6, 2018 · 3 comments · May be fixed by #9532

Comments

@Lenophie
Copy link

Lenophie commented Aug 6, 2018

Expected Behavior

BoxWidth of legend labels should be applied when point styles are being used, particularly 'line'.

Current Behavior

BoxWidth is ignored when using point styles in legend labels.
This is understandable for standard point styles since it would only distort them, but it would be pretty useful for point styles 'line' and 'dash' since their purpose is to style the legend in the first place.
Currently if you use point style 'line' with a dashed line which pattern is rather long, the dashing won't appear in the legend.
And whether you use a dashed line or not, having control over the length of lines (via boxWidth) in the legend would be great.

Here is the legend I get for this dashed line :
1
2
While it works fine for a dashed line with a shorter pattern :
3

Hope a simple fix can be made !

Edit : I know the size can be changed by setting the legend font size to a higher number, but I would rather be able to set the font size independently from the line length.

@Lenophie Lenophie changed the title [FEATURE] Box width not applied when using point style in legend labels [FEATURE] Apply box width when using point style in legend labels Aug 6, 2018
@etimberg
Copy link
Member

Still a thing in v3 https://jsfiddle.net/gp4u3bdw/1/

@Faksimile
Copy link

Faksimile commented Jun 30, 2021

Also very useful when point style is an image.
In my case, I want to have a colored rectangle and an icon as image. At the moment, it's not possible only to increase the box width to give it enough space.
Using v3.4 btw

@andyrichardson andyrichardson linked a pull request Aug 10, 2021 that will close this issue
@andyrichardson
Copy link

Would love to see this - I've made a draft PR demonstrating how we might be able to go about adding support for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants