Highcharts ScrollZoom
by OysteinAmundsen
HTML
<script src="https://code.highcharts.com/stock/highstock.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: {
borderWidth: 0,
zoomType: "x",
animation: false,
height: 200
},
scrollbar: {
enabled: true
},
time: {
useUTC: false
},
title: {
enabled: false
},
legend: {
enabled: false
},
colors: ["#0032FF"],
credits: {
enabled: false
},
plotOptions: {
area: {
threshold: null
},
xrange: {
minPointLength: 1
}
},
xAxis: {
type: "datetime",
labels: {
overflow: "justify"
},
title: {
text: "Date"
}
},
yAxis: {
lineWidth: 1,
tickWidth: 1,
alternateGridColor: "#F2F2F2",
title: {
enabled: false
},
categories: ["Closed", "Open"],
max: 1,
min: 0
},
tooltip: {
borderRadius: 6,
borderColor: "#0032FF",
useHTML: true
},
series: [{
name: "Proximity",
type: "xrange",
turboThreshold: 0,
borderColor: "gray",
animation: 0,
pointWidth: 20,
data: [{
x: 1566283085586,
x2: 1566283591735,
y: 1
},
{
x: 1566283591735,
x2: 1566283595025,
y: 0
},
{
x: 1566283595025,
x2: 1566283694129,
y: 1
},
{
x: 1566283694129,
x2: 1566286589716,
y: 0
},
{
x: 1566286589716,
x2: 1566286665944,
y: 1
},
{
x: 1566286665944,
x2:...