JSFiddle - React, Tailwind, and code Playground
by markwatson
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: 400px; height: 400px; margin: 0 auto"></div>
JavaScript
$(function () {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'area'
},
title: {
text: 'Historic and Estimated Worldwide Population Growth by Region'
},
subtitle: {
text: 'Source: Wikipedia.org'
},
xAxis: {
categories: ['1750', '1800', '1850', '1900', '1950', '1999', '2050'],
tickmarkPlacement: 'on',
title: {
enabled: false
}
},
yAxis: [{
height: 150,
title: {
text: 'Billions'
},
labels: {
formatter: function() {
return this.value / 1000;
}
}
}, {
title: {
text: 'Billions'
},
labels: {
formatter: function() {
return this.value / 1000;
}
},
top: 220,
height: 100,
offset: 0,
lineWidth: 2
}],
tooltip: {
shared: true,
crosshairs: {
color: 'green',
dashStyle: 'solid'
},
formatter: function() {
return ''+
this.x +': '+ Highcharts.numberFormat(this.y, 0, ',') +' millions';
}
},
plotOptions: {
area: {
stacking: 'normal',
lineColor: '#666666',
lineWidth: 1,
marker: {
lineWidth: 1,
lineColor: '#666666'
...