Time series + scrollbar
by amrutaJgtp
HTML
<script src="https://code.highcharts.com/stock/6.1.1/highstock.js"></script>
<div id="container" style="height: 400px"></div>
JavaScript
/**
* Add custom date formats
*/
Highcharts.dateFormats = {
q: function(timestamp) {
var date = new Date(timestamp),
quarter = (Math.floor(date.getUTCMonth() / 3) + 1);
console.log(quarter);
return quarter;
}
};
Highcharts.chart('container', {
"chart": {
"backgroundColor": "rgba(255,255,255,0)",
"plotBackgroundColor": "rgba(255,255,255,0)",
"zoomType": "xy",
"resetZoomButton": {
"theme": {
"fill": "#ffffff",
"stroke": "#003ce1",
"r": 0,
"style": {
"color": "#003ce1",
"cursor": "pointer",
"fontSize": "0.9285714285714286rem",
"fontFamily": "Open Sans"
},
"states": {
"hover": {
"fill": "#003ce1",
"stroke": "#003ce1",
"style": {
"color": "#ffffff",
"fontSize": "0.9285714285714286rem",
"fontFamily": "Open Sans"
}
}
}
}
},
"alignTicks": true,
"options3d": {
"enabled": false
}
},
"title": {
"text": ".",
"style": {
"color": "rgba(255, 255, 255, 0)",
"fontSize": "1px"
}
},
"tooltip": {
"enabled": true,
"shared": false,
"borderWidth": 1,
"borderRadius": 1,
"backgroundColor": "#ffffff",
"style": {
"color": "#000000",
"fontSize": "1rem",
"fontFamily": "Open Sans",
"fontWeight": "normal",
"fontStyle": "normal",
"textDecoration": "none"
},
"crosshairs": [false, false],
"followPointer": true
},
"plotOptions": {
"series": {
"animation": {
"duration": 700
},
"cursor": "pointer",
"allowPointSelect": true,
"showInLegend": true,
"turboThreshold": 0,
"stickyTracking": false,
"events": {},
"point": {
"events": {}
},
"pointPadding": 0.1,
"getExtremesFromAll": true
}
},
"legend": {
"enabled": true,
...