Highcharts Demo
author(s):
Torstein Hønsi
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/heatmap.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="height: auto; margin: 0 auto"></div>
JavaScript
$(function () {
var dates = []
dates = ["15 Jan","16 Jan","17 Jan"];
var data = []
data = [[1,0,2],[1,1,1],[0,2,0]]
var tasks = [];
tasks = [
"Post Go Live Support",
"Go Live Phase 4",
"Deployment to Production",
"Deployment to Production"
];
$('#container').highcharts({
chart: {
type: 'spline',
marginTop: 50,
marginBottom: 80,
height: tasks.length * 80
},
title: {
text: 'Sales per employee per weekday'
},
xAxis: {
categories: dates,
tickPositioner: function () {
var positions = [];
for (tick=0; tick <= dates.length - 1; tick ++) {
positions.push(tick);
}
return positions;
}
},
yAxis: {
categories: tasks,
title: null,
tickPositioner: function () {
var positions = [];
for (tick=0; tick <= tasks.length - 1; tick ++) {
positions.push(tick);
}
return positions;
}
},
colorAxis: {
min: 0,
minColor: '#FFFFFF',
maxColor: Highcharts.getOptions().colors[0]
},
legend: {
enabled: false
},
tooltip: {
formatter: function () {
return '<b>' + this.series.xAxis.categories[this.point.x] + '</b> sold <br><b>' +
this.point.value + '</b> items on <br><b>' + this.series.yAxis.categories[this.point.y] + '</b>';
}
},
series: [{
name: 'Sales per employee',
borderWidth: 1,
data: data,
dataLabels: {
enabled: false,
color: '#000000'
},
turboThreshold: 0
}]
});
});