Highcharts Demo
author(s): Torstein Hønsi
by dacaserna
HTML
<script src="https://code.highcharts.com/js/highcharts.js"></script>
<script src="https://code.highcharts.com/js/modules/xrange.js"></script>
<script src="https://code.highcharts.com/js/modules/exporting.js"></script>
<div id="container"></div>
CSS
@import 'https://code.highcharts.com/css/highcharts.css';
#container {
min-width: 300px;
max-width: 800px;
height: 300px;
margin: 1em auto;
}
.highcharts-xrange-series .highcharts-point {
stroke-width: 1px;
stroke: gray;
}
.highcharts-partfill-overlay {
fill: black;
fill-opacity: 0.3;
}
.highcharts-data-label text {
fill: white;
text-shadow: 1px 1px black, -1px 1px black, -1px -1px black, 1px -1px black;
}
JavaScript
Highcharts.chart('container', {
chart: {
type: 'xrange'
},
title: {
text: 'Highcharts X-range'
},
xAxis: {
type: 'datetime'
},
yAxis: {
title: {
text: ''
},
categories: ['jobs'],
reversed: true
},
series: [{
name: 'Project 3',
pointWidth: 20,
data: [{
name: 'teste3',
x: Date.UTC(2014, 10, 30),
x2: Date.UTC(2014, 11, 13),
y: 0,
partialFill: 1,
color: "blue"
},{
name: 'teste3',
x: Date.UTC(2014, 10, 30),
x2: Date.UTC(2014, 11, 13),
y: 0,
partialFill: 2,
color: "blue"
},{
name: 'teste3',
x: Date.UTC(2014, 10, 30),
x2: Date.UTC(2014, 11, 13),
y: 0,
partialFill: 2,
color: "blue"
},{
name: 'teste3',
x: Date.UTC(2014, 10, 30),
x2: Date.UTC(2014, 11, 13),
y: 0,
partialFill: 1,
color: "blue"
}],
dataLabels: {
enabled: false
}
}]
});