JSFiddle - React, Tailwind, and code Playground
by Angelos Chaidas
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: 600px; height: 500px; margin: 0 auto"></div>
JavaScript
$(function() {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'line',
marginRight: 130,
marginBottom: 25
},
title: {
text: 'Line Chart Demo',
x: -20 //center
},
subtitle: {
enabled: false
},
xAxis: {
categories: ['1st May', '2nd May', '3rd May', '4th May', '5th May', '6th May']
},
yAxis: {
title: {
text: 'Average Salary'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'}]
},
tooltip: {
formatter: function() {
return '<b>' + this.series.name + '</b><br/>' + this.x + ': ' + this.y + '°C';
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -10,
y: 100,
borderWidth: 0
},
series: [{
name: 'Line #1',
data: [45000, 46500, 44542, 44898, 45654, 45542]},
{
name: 'Line #2',
data: [26542, 50454, 65454, 40565, 45654, 32565]}]
});
});
});