I have a graph with 2 yaxis and i am tying to get the yaxis title for each series in the tooltip formatter.
This is my formatter function:
formatter: function() {
var s = '<b>'+ Highcharts.dateFormat('$hc_date_long', this.x) +'</b><table>';
sum = 0;
var abweichung = 0;
var stellen = 0;
$.each(this.points, function(i, point) {
var prev = jQuery.inArray(point.x, point.series.processedXData)-1;
var percent = 0;
if(prev>=0){
prev = point.series.points[prev];
percent = (point.y - prev.y) * 100 / point.y;
}
s += '<tr><td style=\"color: '+point.series.color+';padding:2px;\">'+ point.series.name +':</td><td style=\"text-align:right;padding:2px;\"> '+ extround(point.y,100) +' !!GETYAXISTITLE!!</td><td style=\"text-align:right;padding:2px;\">'+percent+'</td></tr>';
sum += point.y;
});
s += '</table>';
return s;
},
The api only contains the function "setTitle()" there is no getTitle() function?
Correct way to get Y Axis title in tooltip formatter is :
this.point.series.yAxis.axisTitle.textStr
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With