Highcharts Demo
author(s):
Torstein Hønsi
HTML
<script src="https://code.highcharts.com/highcharts.src.js"></script>
<div id="container" style="height: 400px"></div>
JavaScript
$(function() {
Highcharts.wrap(Highcharts.Tooltip.prototype, 'refresh', function(p, point, mouseEvent) {
p.call(this, point, mouseEvent);
if (!this.isHidden && !this.shared && !this.split) {
var pointTooltipBorderColor = point && point.options.tooltip && point.options.tooltip.borderColor,
seriesTooltipBorderColor = point && point.series && point.series.options.tooltip && point.series.options.tooltip.borderColor,
borderColor = pointTooltipBorderColor || seriesTooltipBorderColor,
label = this.label;
if (label && borderColor) {
label.attr({
stroke: borderColor
});
}
}
});
var data = [194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4];
console.log(data, data.reverse());
$('#container').highcharts({
tooltip: {
borderColor: 'red',
borderWidth: 3
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
series: [{
tooltip: {
borderColor: 'green'
},
data: [{
y: 29.9,
tooltip: {
borderColor: 'yellow'
}
}, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}, {
tooltip: {
borderColor: 'blue'
},
data: data
}, {
data: data.slice().reverse()
}]
});
});