JSFiddle - React, Tailwind, and code Playground
by Philip Kent
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://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: 'area'
},
title: {
align: 'left',
text: 'Energy Production from Fossil Fuels',
style: {
'color': '#339966',
'font-family': 'Palatino Linotype'
}
},
subtitle: {
align: 'left',
text: 'Source: IEA (https://www.iea.org/)',
style: {
'color': '#339966',
'font-family': 'Palatino Linotype'
}
},
legend: {
itemStyle: {
'color': '#339966',
'font-family': 'Palatino Linotype'
}
},
xAxis: {
categories: ['1971', '1972', '1973', '1974', '1975', '1976', '1977', '1978', '1979', '1980', '1981', '1982', '1983', '1984', '1985', '1986', '1987', '1988', '1989', '1990', '1991', '1992', '1993', '1994', '1995', '1996', '1997', '1998', '1999', '2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012', '2013', '2014'],
tickmarkPlacement: 'on',
labels: {
style: {
'color': '#339966',
'font-family': 'Palatino Linotype'
}
},
title: {
enabled: false
}
},
yAxis: {
title: {
text: 'GWh',
style: {
'color': '#339966',
'font-family': 'Palatino Linotype'
}
},
labels: {
style: {
'color': '#339966',
'font-family': 'Palatino Linotype'
}
},
},
tooltip: {
split: false,
valueSuffix: ' GWh'
},
plotOptions: {
area: {
stacking: 'normal',
lineColor: '#666666',
lineWidth: 1,
marker: {
enabled: false,
}
}
},
series: [{
name: 'Asia',
data: [197714, 221217, 239611, 242692, 277850, 301563, 332192, 374557, 404572, 431530, 439317, 465910, 494082, 538285, 588660, 655469, 743579, 818478, 895055, 953778, 1066448, 1181293, 1301498, 1398755, 1533825, 1671131, 1783364, 1846095,...