JSFiddle - React, Tailwind, and code Playground
by Michel Penke
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 680px"></div>
JavaScript
chart = new Highcharts.Chart({
style: {
fontFamily: 'Arial'
},
chart: {
renderTo: 'container',
type: 'column'
},
title: {
text: ''
},
subtitle: {
text: ''
},
xAxis: {
categories: ["Location A","Location B","Location C"],
title: {
text: "Location"
}
},
yAxis: {
allowDecimals: false
},
plotOptions: {
series: {
dataLabels: {
enabled: true,
formatter: function() {
if (this.y === 0) {
return null;
}
return this.y;
},
style: {
color: 'white'
}
}
},
column: {
stacking: 'normal',
borderWidth: 0
}
},
series: [{
"color": "rgb(0,0,255)",
"name": "Open Jul",
"data": [18, 2, 6],
"stack": "Jul"
},
{
"color": "rgb(255,0,0)",
"name": "Overdue Jul",
"data": [0, 0, 0],
"stack": "Jul"
},
{
"color": "rgb(0, 0, 255)",
"name": "Open Aug",
"data": [20, 1, 10],
"stack": "Aug"
},
{
"color": "rgb(255, 0, 0)",
"name": "Overdue Aug",
"data": [2, 1, 2],
"stack": "Aug"
}],
yAxis: {
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
color: 'gray'
},
formatter: function() {
return this.stack;
}
}
}
});