I need some help to find a solution to display the difference between the series in the tooltip.
Here <- is a simple screenshot with my problem:
how can i sol
Use tooltip.formatter
- you have there access to the points (this.points[0]
, this.points[1]
etc.). Just calculate different between y-values.
Note: tooltip.formatter
is available only on the highest level of options, like in the API.
Demo: http://jsfiddle.net/bwefs1ak/
tooltip: {
formatter: function () {
var s = '<b>' + Highcharts.dateFormat('%A, %b %e, %Y', this.x) + '</b>';
$.each(this.points, function () {
s += '<br/>Value: ' + this.y;
});
s+= '<br>Diff: ' + ( this.points[0].y - this.points[1].y );
return s;
}
},