我使用下面的代码添加该系列。现在我们谈论的是10~20系列,这样做时UI会卡住并且变得越来越慢。这发生在 PC 浏览器中。我希望在平板电脑 (kitkat) 上的 Android WebVIEW 中使用这些图表。
对于如何提高性能有什么建议吗?
for (var x in currentSerie) {
chart.addSeries({
name: currentSerie[x].Name,
data: currentSerie[x].Data,
lineWidth: currentSerie[x].lineWidth || 1,
color: currentSerie[x].color || '',
dataGrouping: {
approximation: "average",
enabled: false,
forced: true,
units: [['hour', [1]]]
},
marker: {
enabled: true,
radius: 1
},
tooltip: {
valueDecimals: 1,
valueSuffix: currentSerie[x].Unit || ''
},
shadow: false,
}, false);
}
chart.redraw();
最佳答案
我遇到了同样的问题,并发现以下问题是罪魁祸首。
marker: {
enabled: true,
radius: 1
},
如果您取消强制启用标记并让图表确定何时显示标记,则性能会好得多。
关于javascript - 添加超过 10 个系列时 Highcharts 性能下降,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25069907/