JSFiddle - React, Tailwind, and code Playground
by amrutaJgtp
HTML
<script src="http://code.highcharts.com/highcharts-more.js"></script>
<script src="http://code.highcharts.com/stock/highstock.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="height: 400px"></div>
JavaScript
$(function () {
$('#container').highcharts({
chart: {
type: 'column',
zoomType: 'xy'
},
title: {
text: 'Salary Of EmployeeByDept (DD-MM-YYYY HH)'
},
xAxis: {
title:{
text:'EmployeeByDept by Join Date'
},
type: 'datetime',
labels: {
format: '{value:%d-%m-%Y %H}',
rotation: -45,
style: {
fontSize: '13px',
fontFamily: 'Verdana, sans-serif'
}
},
showFirstLabel: true,
startOnTick: false,
minPadding: 0,
units: [
[
'hour', [1, 2, 3, 4, 6, 8, 12]],
[
'day', [1, 10]],
[
'month', [1, 3, 6]],
[
'year',
null]
]
},
yAxis: {
title: {
text: 'Salary'
},
min:0
},
scrollbar : {
enabled:true
},
series: [{
data: [
[Date.UTC(2010, 1, 1,0), 500000],
[Date.UTC(2010, 1, 1,1), 700000],
[Date.UTC(2010, 1, 1,3), 700000],
[Date.UTC(2010, 1, 1,6), 400000],
[Date.UTC(2010, 1, 1,9), 500000],
[Date.UTC(2010, 1, 1,12), 700000],
[Date.UTC(2010, 1,1,15), 400000],
[Date.UTC(2010, 1,1,16), 630000],
[Date.UTC(2010, 1,1,18), 200000],
[Date.UTC(2010, 1,1,21), 510000],
[Date.UTC(2010, 1,2,0), 700000],
[Date.UTC(2010, 1, 2,0), 500000],
[Date.UTC(2010, 1, 2,1), 700000],
[Date.UTC(2010, 1, 2,3), 700000],
...