Reputation: 37
I am working highcharts trying to create a column chart that has a customized tooltip.I would like this tool to show the y value of the column, and a couple of other pieces of data for the position. Something like : 22,000 net 22,001 CR 22,002 Dr I have the series for the points set up as follows:
series: [
{
name: 'Amount',
data: [22000, 21000, 19000,4000,27000,1000],
Credit:[22001, 21001, 19001,4001,27001,1001],
Debit: [22002, 21002, 19002,4002,27002,1002]
}
and I am using a tooltip formatter function as follows:
tooltip: {formatter: function(){
return 'the value here is ' + this.y + this.point.Credit
But I am getting undefined for the credit value. Any suggestions would be greatly appreciated. thanks
I have a jsfiddle of this at :
http://jsfiddle.net/bryands1/5uowfx7v/9/
Upvotes: 1
Views: 1250
Reputation: 7896
To access this kind of series data use path like:
this.series.options.Credit[this.point.index]
Example with your data: http://jsfiddle.net/5uowfx7v/32/
Upvotes: 2
Reputation: 746
You can access it in tooltip formatter function:
this.series.options.Credit
So your code would be
tooltip: {
formatter: function(){
return 'the value here is ' + this.y + ' ' + this.series.options.Credit[0]
}
}
Upvotes: 3