Highcharts Demo
author(s):
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/xrange.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container"></div>
CSS
#container {
min-width: 300px;
max-width: 800px;
height: 300px;
margin: 1em auto;
}
JavaScript
Highcharts.chart('container', {
chart: {
type: 'xrange',
height: 500
//plotAreaHeight: 200
},
title: {
text: 'Highcharts X-range'
},
xAxis: {
type: 'datetime'
},
yAxis: {
title: {
text: ''
},
categories: ['Weather', 'Road', 'Blowing Snow','Bridge Frost'],
reversed: true
},
plotOptions: {
series: {
cursor: 'pointer',
point: {
events: {
click: function () {
location.href = this.options.url;
}
}
}
}
},
series: [{
name: 'Project 1',
// pointPadding: 0,
// groupPadding: 0,
borderColor: 'gray',
pointWidth: 40,
data: [{
x: 1537387200000,
x2: 1537430400000,
y: 0,
color: 'green',
url: 'https://en.wikipedia.org/wiki/United_States',
/* partialFill: 0.25 */
}, {
x: 1537387200000,
x2: 1537430400000,
y: 1,
color: 'red'
}, {
x: 1537387200000,
x2: 1537430400000,
y: 2,
color: 'green'
},{
x: 1537387200000,
x2: 1537430400000,
y: 3,
color: 'green'
}, {
x: 1537430400000,
x2: 1537473600000,
y: 0,
color: 'green'
},{
x: 1537430400000,
x2: 1537473600000,
y: 1,
color: 'yellow'
},{
x: 1537430400000,
x2: 1537473600000,
y: 2,
color: 'green'
},{
x: 1537430400000,
x2: 1537473600000,
y: 3,
color: 'red'
}, {
x: 1537473600000,
x2: 1537646400000,
y: 0,
color: 'yellow'
...