【发布时间】:2017-08-03 13:34:09
【问题描述】:
我没有看到范围选择器,但我已经在代码中编写了它。 我已经使用变量初始化了图表,例如:
var chart = Highcharts.chart('chartContainer', {
xAxis: {
type: 'datetime',
tickPixelInterval: 150
},
yAxis: {
title: {
text: 'Érték'
},
plotLines: [{
value: 0,
width: 20,
color: '#FFFFFF'
}]
},
//animation: Highcharts.svg,
boost: {
seGPUTranslations: true
},
rangeSelector: {
buttonTheme: { // styles for the buttons
fill: 'none',
stroke: 'none',
'stroke-width': 0,
r: 8,
style: {
color: '#039',
fontWeight: 'bold'
},
allButtonsEnabled: true,
states: {
hover: {},
select: {
fill: '#039',
style: {
color: 'white'
}
}
// disabled: { ... }
}
}
},
title: {
text: 'Prociszenzor'
},
series: []
});
如您所见,它不包含任何系列,我确实从另一个代码中添加了它:
chart.addSeries({
type: 'line',
name: dataaa.ertekek[i].neve + " " + dataaa.ertekek[i].mertek,
data: [{
y: dataaa.ertekek[i].ertek / 100,
x: time
}]
});
Dataaa 来自 JSON 文件。 我确实将此数组推送到主图表数组,并使用 addPoint 函数向其添加点。我想做一个范围选择器,但我不知道该怎么做。
【问题讨论】:
标签: javascript json highcharts