Highcharts Demo
author(s): Torstein Hønsi
by J_Code_2025
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: 400px; width: 500px; margin: 0 auto"></div>
JavaScript
$(function () {
$('#container').highcharts({
chart: {
type: 'heatmap',
marginTop: 40,
marginBottom: 80,
plotBorderWidth: 1
},
title: {
text: 'Sales per employee per weekday'
},
xAxis: {
categories: ['Alexander', 'Marie', 'Maximilian', 'Sophia', 'Lukas', 'Maria', 'Leon', 'Anna', 'Tim', 'Laura']
},
yAxis: {
categories: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
title: null
},
colorAxis: {
min: 0,
minColor: '#FFFFFF',
maxColor: Highcharts.getOptions().colors[0]
},
legend: {
align: 'right',
layout: 'vertical',
margin: 0,
verticalAlign: 'top',
y: 25,
symbolHeight: 280
},
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: [{
//rowsize: 0.9,
//colsize: 0.85,
rowsize: 0.8,
colsize: 1,
name: 'Sales per employee',
borderWidth: 4,
data: [
[0, 0, 10],
/*[0, 1, 19],
[0, 2, 8],
[0, 3, 24],
[0, 4, 67],*/
[1, 0, 92],
/*[1, 1, 58],
[1, 2, 78],
[1, 3, 117],
[1, 4, 48],*/
[2, 0, 35],
/*[2, 1, 15],
[2, 2, 123],
[2, 3, 64],
[2, 4, 52],*/
[3, 0, 72],
/*[3, 1, 132],
[3, 2, 114],
[3, 3, 19],
[3, 4, 16],*/
[4, 0, 38],
...