Reputation: 171
I am using a custom formatter for yAxis in highcharts. The following gives me the current y axis value:
yAxis: {
labels:{
formatter: function(){
return this.value
}
}
}
Is there a way that I can also access the coordinate's x-axis value, and z-axis value inside the formatter function? I can get all the values, but not the corresponding x, and z values.
Upvotes: 0
Views: 485
Reputation: 4562
First of all you need to check the chart object from console like this;
yAxis: {
labels:{
formatter: function(){
console.log(this);
}
}
}
You can find any needed value in this object. For example; this.chart.xAxis[0].categories[0]
will give you the value of first element on xAxis.
Upvotes: 1