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/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'
},
title: {
text: 'Infant mortality '
},
subtitle: {
text: 'Source: The Henry J Kaiser Family Foundation'
},
xAxis: {
categories: ['United States', 'Indiana' ],
title: {
text: null
}
},
yAxis: {
min: 0,
title: {
text: 'By James Benedict',
align: 'high'
},
labels: {
overflow: 'justify'
}
},
tooltip: {
valueSuffix: ' deaths per 1000 deaths'
},
plotOptions: {
bar: {
dataLabels: {
enabled: true
}
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -40,
y: 100,
floating: true,
borderWidth: 1,
backgroundColor: ((Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'),
shadow: true
},
credits: {
enabled: false
},
series: [{
name: 'Black',
color: '#9ADCC6',
data: [12.2, 14.1]
}, {
name: 'Hispanic',
color: '#CD894E',
data: [5.4, 6.8]
}, {
name: 'White',
color: '#44697D',
data: [5.3, 6.5]
}]
});
});