Add additional data to a Highcharts series for use in formatters

This appears to have been revised with later iterations of HighCharts/HighStocks. The jsfiddle example no longer works. Using the "this.series.options.hasCustomFlag" syntax results in "undefined". The debugger shows the data I'm looking for is in "this.series.userOptions.data" - an unsorted very large array, but the entire series is there - not the specific record data you normally get with this.x or this.y.


Yes this is possible, the extra configuration properties is located under the options property (this.series refers to the series instance, not the configuration objects). See the reference here and scroll down to properties section.

So instead use this line in the formatter:

if (this.series.options.hasCustomFlag) { ... }

Full example on jsfiddle

Tags:

Highcharts