JavaScript
$(function() {
$('#container').highcharts({
/* chart: {
zoomType: 'x'
}, */
title: {
text: 'Month Compare'
},
/* legend: {
'align': 'centre'
}, */
xAxis: [{
type: "datetime",
dateTimeLabelFormats: {
day: '%e %b (%w)'
},
title: {
text: 'March'
}
}, {
type: "datetime",
dateTimeLabelFormats: {
day: '%e %b (%w)'
},
title: {
text: 'Compare Feb'
}
}],
/* yAxis: [{ // Primary yAxis
labels: {
style: {
color: Highcharts.getOptions().colors[2]
}
},
title: {
text: 'Sales',
style: {
color: Highcharts.getOptions().colors[2]
}
},
}], */
tooltip: {
/* shared: true,
formatter: function() {
var s = "";
s += "x0=" + Highcharts.dateFormat("%e %b", this.points[0].x) + "<br/>";
s += "x1=" + Highcharts.dateFormat("%e %b", this.points[1].x) + "<br/>";
s += "y0=" + this.points[0].y + "<br/>";
s += "y1=" + this.points[1].y + "<br/>";
s += "change="+format_change(this.points[1].y, this.points[0].y) + "<br/>";
return s;
}, */
},
/* legend: {
enable: false
}, */
series: [{
name: 'March Sales',
xAxis: 0,
dashStyle: 'shortdot',
data: [
[Date.UTC(2016, 2, 1, 00, 00, 00), 50.9],
[Date.UTC(2016, 2, 2, 00, 00, 00), 45.9],
[Date.UTC(2016, 2, 3, 00, 00, 00), 41.9],
[Date.UTC(2016, 2, 4, 00, 00, 00), 48],
[Date.UTC(2016, 2, 5, 00, 00, 00), 51],
[Date.UTC(2016, 2, 6, 00, 00, 00), 56],
[Date.UTC(2016, 2, 7, 00, 00, 00), 53.2],
[Date.UTC(2016, 2, 8, 00, 00, 00), 52],
[Date.UTC(2016, 2, 9, 00, 00, 00), 48],
[Date.UTC(2016, 2, 10, 00, 00, 00), 38],
[Date.UTC(2016, 2, 11, 00, 00, 00), 50],
[Date.UTC(2016, 2, 12, 00, 00, 00), 51],
...