I am currently using highcharts and there is a requirement for my project to group categories of series names together in the legend but I can't seem to find a way to do this.
There are 3 "categories" of data series that the PM would like to have displayed in 3 columns in the legend. The biggest issue is that one of the 3 categories has a variable number of elements depending on the features selected for inclusion in the chart.
E.G.
In one instance the series might be:
Apples, Pears, Peppers, Cucumbers, Beets, Oranges, Potatoes, Tomatoes, Turnips
and they need to be displayed in the legends like:
+------------------------------+
| Apples Tomatoes Beet |
| Oranges Peppers Potatoes |
| Pears Cucumbers Turnips |
+------------------------------+
In another case the series might be:
Tomatoes, Apples, Oranges, Peppers, Cucumbers, Potatoes, Pears
and they need to be displayed in the legend like:
+------------------------------+
| Apples Tomatoes Potatoes |
| Oranges Peppers |
| Pears Cucumbers |
+------------------------------+
Is there a way to get this type of formatting with a variable number of series?
This is not possible by the use of default API, but you could create custom legend that will take care of building a proper array.
Example of how to create a custom legend: http://jsfiddle.net/N3KAC/87/