JSFiddle - React, Tailwind, and code Playground
by mlmason
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: 'line'
},
title: {
text: 'Monthly Average Temperature'
},
subtitle: {
text: 'Source: WorldClimate.com'
},
xAxis: {
categories: ['1960', '1965', '1970', '1975', '1980', '1985', '1990', '1995', '2000', '2005', '2010', '2014']
},
yAxis: {
title: {
text: 'Violent Crime per 10,000 people'
}
},
plotOptions: {
line: {
dataLabels: {
enabled: true
},
enableMouseTracking: false
}
},
series: [{
name: 'Michigan',
data: [22, 30, 58, 69, 64, 73, 79, 69, 55, 55, 49, 43]
}, {
name: 'United States',
data: [16, 20, 36, 49, 60, 56, 73, 69, 51, 47, 40, 36]
}]
});
});