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

❓ [QUESTION] What is the best way to handle long text in legend? #70

Open
enkr1 opened this issue Nov 24, 2022 · 7 comments
Open

❓ [QUESTION] What is the best way to handle long text in legend? #70

enkr1 opened this issue Nov 24, 2022 · 7 comments

Comments

@enkr1
Copy link

enkr1 commented Nov 24, 2022

I have a long text for my legend and it shows up being cut. I was trying to play around with the :legend_setting like legend_setting: :legend_bottom but couldn't make it work except :legend_right ...

image

I am wondering if there are any other options or alternatives to solve long text in legend.

Thank you so much in advance. ❤️

Best regards,
Jing Hui P.

@enkr1 enkr1 changed the title [QUESTION] What are the options for :legend_setting? [QUESTION] What is the best way to handle long text in legend? Nov 24, 2022
@enkr1 enkr1 changed the title [QUESTION] What is the best way to handle long text in legend? ❓ [QUESTION] What is the best way to handle long text in legend? Nov 24, 2022
@mindok
Copy link
Owner

mindok commented Nov 25, 2022

Good question - looking through the legend code it appears there is a TODO for the :legend_top setting to work. I should have a chance early next week to put in the remaining legend options - there is nothing too difficult in there.

@enkr1
Copy link
Author

enkr1 commented Nov 25, 2022

Good question - looking through the legend code it appears there is a TODO for the :legend_top setting to work. I should have a chance early next week to put in the remaining legend options - there is nothing too difficult in there.

Thank you so much @mindok, will be waiting for your PR then! :D

@mindok
Copy link
Owner

mindok commented Nov 29, 2022

Ok, turned out to be a bit more fiddly than I thought - changes aren't pushed yet, but it is looking like this:
image

Currently there will be only :legend_top in addition to :legend_right, but things are now in place to add bottom & left. Also, there is strange behaviour if there isn't enough room to display the legend and plot content, but I won't address that yet. Finally, the legend isn't smart enough to put two entries on one line for the top legend.

@enkr1
Copy link
Author

enkr1 commented Nov 29, 2022

Ok, turned out to be a bit more fiddly than I thought - changes aren't pushed yet, but it is looking like this: image

Currently there will be only :legend_top in addition to :legend_right, but things are now in place to add bottom & left. Also, there is strange behaviour if there isn't enough room to display the legend and plot content, but I won't address that yet. Finally, the legend isn't smart enough to put two entries on one line for the top legend.

that's nice! I would be using the :legend_bottom (it would be bottom left right?) once u merge it.

@mindok
Copy link
Owner

mindok commented Nov 29, 2022

:legend_bottom just committed. Pie charts with a title start looking slightly strange depending on the size of the SVG view - the title is placed at the middle of the calculated content area, but if height is a lot less than width, the content area is then shrunk in width. Anyway, a problem for another day!

You will need to point your reference to Contex in mix.exs to GitHub (e.g. {:contex, git: "https://github.com/mindok/contex"},) to take advantage of the changes until another release is made.

image

@mindok
Copy link
Owner

mindok commented Nov 29, 2022

PS - you will need to do mix deps.update contex after updating your mix.exs

@enkr1
Copy link
Author

enkr1 commented Feb 8, 2023

Hi @mindok, thank you so much last year for the speed response and fixes.

I have a request if there is any possibility that you can make it centre?
image

Thank you so much!

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

No branches or pull requests

2 participants