0
我没有看到范围选择器,但是我已经在代码中写入了该选择器。 我一直在使用的变量,像初始化图表:如何使用Highcharts功能获得工作范围选择器?
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函数为其添加了点。我想制作一个范围选择器,但我不知道如何做到这一点。
嗯。我忘了写入启用:真,进入代码。 – jhsznrbt