highcharts - how to display both the series value in plotoptions mouseover event -
using tooltip formatter can display both series name , value when same done using plotoptions event mouseover not able series name , value
tooltip: formatter
plotoption:mousover
mouseover: function () { $.each(this, function (i, e) { $reporting.html('x: ' + this.x + 'category: ' + this.series.name + ', y: ' +highcharts.numberformat(math.abs(this.y))); }); }
example of using in mouseover
mouseover: function () { console.log(this); var series = this.series.chart.series, x = this.x, y = this.y, output = 'x: ' + x + 'y: ' + highcharts.numberformat(math.abs(y)); //loop each serie $.each(series, function (i, e) { output += ' category: ' + this.name; if(i>0) { $.each(series[i].data,function(j,point){ if(point.x === x) { output += ' y: ' + highcharts.numberformat(math.abs(y)); } }); } }); $reporting.html(output); } } },
Comments
Post a Comment