I have a HighStock chart that renders data for the previous 24hrs, from that data I want to by default only show the last 2hrs and allow the user to drag it back if they want to see more.
I know there are defaults that can be used with the Range Selector options though I dont want this rendered on the page. An option would be to hide this also.
Here is a JS fiddle:
$(function() {
$.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json&callback=?', function(data) {
// Create the chart
$('#chart').highcharts('StockChart', {
rangeSelector : {
//selected : 1,
enabled: false
},
title : {
text : 'AAPL Stock Price'
},
series : [{
name : 'AAPL',
data : data,
tooltip: {
valueDecimals: 2
}
}]
});
});
});
Thanks Dave
您始终可以为xAxis设置min
和max
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.