Limit the number of items per line in legend
I may not know what the names of my series will be, nor their length, but I know how I want to organize them in my legend (2x3, 2x2, ...).
It would be great if we could set in the legend's options the number max of items per line.
Htos Tam commented
itemWidth is not what I need, the main issue here is that when legend items become wrapping, we have about 50px empty space on the right, which makes visually aligning more to the left, even though they are aligned in the center. How to just point max number of items per row without using this wrapping feature?
Kevin Walker commented
For our purpose, we need the ability to display legend items in-line with equal padding between one another UNTIL the legend items break to 2 lines. In which case, we need the legend items to display in a columnar layout (like Maxime74 mentioned; 3x3, 2x2, 3x2, 4x2, 4x1, etc.). For our use, this ensures the legend looks aesthetically pleasing as the chart is resized or as new data comes in (or out). Here is a Jing screencast walking through what I mean with one of our charts: https://screencast.com/t/KFHjAPpqO
The reason Highcharts doesn't work today is that it displays legend items in-line, ALWAYS. We like in-line behavior when the chart has one row of legend items, but not when it breaks to two lines.
Feel free to reach out - happy to discuss whenever.
I've been trying this option, but in my case, I can have a column with long series name, and some others with short names. So it may be not very good-looking.
Would the itemWidth option work for you? It will align the items nicely, especially when combined with the same styles.width.