Improve tooltip.formatter documentation
Just from the documentation https://api.highcharts.com/highcharts/tooltip.formatter it is not clear what you have to return from your formatter call. It suggests that you always return a string (basend on the provided examples)
However when you dig into some issues and SO it is clear that for split tooltips you also can return an Array. First entry will be the x-label tooltip and then each following entry is one point.
Just couple of examples how hard it is to find this is actually possible:
https://stackoverflow.com/questions/45981514/highstock-tooltip-formatter-if-using-split-true?rq=1
https://github.com/highcharts/highcharts/issues/6115
https://github.com/highcharts/highcharts/pull/5976
and even the type definition is not complete https://api.highcharts.com/class-reference/Highcharts.html#.FormatterCallbackFunction%3CT%3E
I'd suggest simply extend the documentation (either for the split option or the formatter), to properly document this Array return feature
Thanks for the feedback! I have improved the description and added a live demo. See https://github.com/highcharts/highcharts/commit/32200d866ea5fa454e9365021f0ab3ec9bec5f34. Live demo at https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/tooltip/formatter-split/
-
Nicolas Gehlert commented
awesome thanks
-
Nicolas Gehlert commented
example to see this in action http://jsfiddle.net/ow1cnjgv/1/