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; height: 400px; margin: 0 auto"></div>
JavaScript
$(function () {
$('#container').highcharts({
chart: {
type: 'column'
},
title: {
text: 'Student Loan Volume'
},
xAxis: {
categories: ['2009-10', '2010-11', '2011-12', '2012-13', '2013-14']
},
yAxis: {
min: 0,
title: {
text: 'Million Dollars'
},
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
}
}
},
legend: {
align: 'right',
x: -30,
verticalAlign: 'top',
y: 25,
floating: true,
backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',
borderColor: '#CCC',
borderWidth: 1,
shadow: false
},
tooltip: {
formatter: function () {
return '<b>' + this.x + '</b><br/>' +
this.series.name + ': ' +'$' + this.y + ' million' + '<br/>' +
'Total: ' + '$' + this.point.stackTotal + ' million';
}
},
plotOptions: {
column: {
stacking: 'normal',
dataLabels: {
enabled: true,
color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white',
style: {
textShadow: '0 0 3px black'
}
}
}
},
series: [
{
name: 'Private',
color: '#C59217',
data: [42.5, 35.4, 37.3, 39.0, 42.2]
},
{
name: 'PLUS',
color: '#AEA79F',
data: [47.9, 54.1, 52.8, 48.7, 47.8]
},
{
...