22
rated 0 times
[
24]
[
2]
/ answers: 1 / hits: 20054
/ 10 Years ago, sat, november 29, 2014, 12:00:00
How can I get the tooltip seen in the image below to be displayed as shared?
You might want to take a look at the Highcharts API Reference (especially the info about the shared option): http://api.highcharts.com/highcharts#tooltip.formatter
Here's the jsfiddle: https://jsfiddle.net/9bw1qLj4/
for fullscreen: https://jsfiddle.net/9bw1qLj4/embedded/result/
I tried this, but it didn't work:
tooltip: {
shared: true,
formatter: function () {
var y_value_kwh = (this.points[i].y/1000).toFixed(2);
return '<span style=font-size: 10px>' + this.key + '</span><br/>' + '<span style=color:' + this.points[i].series.color + '>u25CF</span> ' + this.points[i].series.name + ': <b>' + y_value_kwh + ' kWh</b><br/>';
},
},
Current code:
tooltip: {
//shared: true,
formatter: function () {
var y_value_kwh = (this.y/1000).toFixed(2);
return '<span style=font-size: 10px>' + this.key + '</span><br/>' + '<span style=color:' + this.series.color + '>u25CF</span> ' + this.series.name + ': <b>' + y_value_kwh + ' kWh</b><br/>';
},
},
Current output:
More From » jquery