Highcharts Demo
author(s):
Torstein Hønsi
by HemalathaThanigaivel
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container"></div>
CSS
#container {
min-width: 300px;
max-width: 800px;
margin: 0 auto;
}
JavaScript
Highcharts.chart('container', {
title: {
text: 'Highcharts with a shared tooltip formatter'
},
xAxis: {
categories: [
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
],
crosshair: true
},
tooltip: {
/* formatter: function () {
return this.points.reduce(function (s, point) {
return s + '<br/>' + point.series.name + ': ' +
point.y + 'm';
}, '<b>' + this.x + '</b>');
}, */
shared: true,
useHTML: true,
headerFormat:
'<table><tr><th colspan="2"> {point.key} (Customers Count)</th></tr>',
pointFormat:
'<tr><td style="color: {series.color}">{series.name} </td>' +
'<td style="text-align: left"><b>{point.y}</b></td></tr>',
footerFormat: "</table>",
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4,
194.1, 95.6, 54.4]
}, {
data: [216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5]
}]
});