JSFiddle - React, Tailwind, and code Playground
by jbenedict
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/data.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<!-- Additional files for the Highslide popup effect -->
<script type="text/javascript" src="http://www.highcharts.com/media/com_demo/highslide-full.min.js"></script>
<script type="text/javascript" src="http://www.highcharts.com/media/com_demo/highslide.config.js" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="http://www.highcharts.com/media/com_demo/highslide.css" />
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
JavaScript
$(function () {
$('#container').highcharts({
chart: {
type: 'column'
},
title: {
text: 'Breakdown of prescriptions ordered by the jail'
},
xAxis: {
categories: ['2010', '2011', '2012', '2013', '2014']
},
yAxis: {
min: 0,
title: {
text: 'Percent of total prescriptions ordered'
}
},
tooltip: {
pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.percentage:.0f}%)<br/>',
shared: true
},
plotOptions: {
column: {
stacking: 'percent'
}
},
series: [{
name: 'Mental, emotional disorders',
data: [295, 248, 141, 374, 466]
},{
name: 'High blood pressure',
data: [539, 530, 759, 954, 307]
}, {
name: 'Antibiotics',
data: [179, 237, 264, 227, 236]
},{
name: 'Diabetes',
data: [71, 29, 57, 79, 137]
}, {
name: 'Painkillers',
data: [42, 37, 55, 64, 115]
}, {
name: 'Other',
data: [637, 441, 403, 627, 691]
}]
});
});