我正在使用 highcharts 股票图表 similar to this 。我的图表有数百个数据点。有没有办法以编程方式预设图表下方的时间 slider ?
假设我的 X 轴有 100 个数据点(日期时间,按秒分组)。我希望图表的默认 View 让选择器显示 20 个点。积分40-60
这是我正在使用的示例:
$(function () {
$('#container').highcharts('StockChart', {
rangeSelector: {
buttonTheme: { // styles for the buttons
fill: 'none',
stroke: 'none',
'stroke-width': 0,
r: 8,
style: {
color: '#039',
fontWeight: 'bold'
},
states: {
hover: {
},
select: {
fill: '#039',
style: {
color: 'white'
}
}
// disabled: { ... }
}
},
inputBoxBorderColor: 'gray',
inputBoxWidth: 120,
inputBoxHeight: 18,
inputStyle: {
color: '#039',
fontWeight: 'bold'
},
labelStyle: {
color: 'silver',
fontWeight: 'bold'
},
selected: 1
},
series: [{
name: 'USD to EUR',
data: usdeur
}]
});
});
最佳答案
在此example ,股票图表绘制有 300 个点。接下来,正在检索点 [40] 和 [60] 的时间戳,并且 setExtremes()
调用以设置底部导航器的最小和最大时间戳。
关于javascript - Highcharts 股票图表时间选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37801430/