❓ [QUESTION] What is the best way to handle long text in legend?
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 ...
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.
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.
Good question - looking through the legend code it appears there is a TODO for the
:legend_topsetting 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
Ok, turned out to be a bit more fiddly than I thought - changes aren't pushed yet, but it is looking like this:

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.
Ok, turned out to be a bit more fiddly than I thought - changes aren't pushed yet, but it is looking like this:
Currently there will be only
:legend_topin 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.
: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.

PS - you will need to do mix deps.update contex after updating your mix.exs
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?

Thank you so much!