Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Legend style improvements #190

Closed
wants to merge 11 commits into from

Conversation

d-Rickyy-b
Copy link

@d-Rickyy-b d-Rickyy-b commented Feb 8, 2022

This PR builds on top of #189 and it improves some visual issues such as some poorly chosen paddings and it fixes the issue that for several legends users weren't able to provide custom paddings.

To get a feeling how I adjusted the default paddings between vertical legend elements:

Old:
output_old

New:
output_new

Prior to this commit we simply defined a hardcoded padding. This commit respects the passed style and inherits from a default padding defined in legendDefaults.
The stroke length was just way too long, so I first tried to decrease the length by subtracting the padding from it, but it was not a big difference.
I ended up using a hardcoded value because it gave the best visual results on different resolutions.
Prior to this commit the paddings passed within the style struct for the different legend objects were ignored. This commit fixes that behavior.
Legends need to use their individual text spacing - not use the Tick spacing. For vertical lists it looks a lot better to use a spacing of 10 instead of 20. Prior to this commit this couldn't be set in the defaults without also manipulating the axis tick spacing.
Using their own constant, this can be now easily configured.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant