JSFiddle - React, Tailwind, and code Playground
by kannankeril
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>
JavaScript
$(function () {
$('#container').highcharts({
chart: {
type: 'bar'
},
colors: ['grey','orange'],
title: {
text: 'Resource Status'
},
xAxis: {
categories: ['Manny', 'Lindsay', 'Abraham']
},
yAxis: {
min: 0,
max: 2,
categories: ['22/09/2013', '25/09/2013', '26/09/2013'],
title: {
text: 'Week Starting'
}
},
legend: {
enabled: false
},
plotOptions: {
series: {
stacking: 'normal',
threshold: -0.5,
dataLabels: {
enabled: true,
inside: true,
color: 'white',
formatter: function () {
var ret = this.y * 100;
if(this.series.name == 'd1_yes') ret += 50;
return ret +'%';
}
}
}
},
series: [{
name: 'd3_no',
data: [{y: 0.5, p: 50}, 0.5, 0.3]
}, {
name: 'd3_yes',
data: [0.5, 0.5, 0.7]
}, {
name: 'd2_no',
data: [0.7, 0.2, 0.8]
}, {
name: 'd2_yes',
data: [0.3, 0.8, 0.2]
}, {
name: 'd1_no',
data: [0.7, 0.2, 0.8]
}, {
name: 'd1_yes',
data: [-0.2, 0.3, -0.3]
}]
});
});