【发布时间】:2016-06-14 01:06:42
【问题描述】:
我正在使用 highcharts 股票图表 similar to this。我的图表有数百个数据点。有没有办法以编程方式预先设置图表下方的时间滑块?
假设我的 X 轴有 100 个数据点(日期时间,按秒分组)。我希望图表的默认视图让选择器显示 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
}]
});
});
【问题讨论】:
-
我的回答解决了你的问题吗?
标签: javascript jquery charts highcharts