4

I have a highchart displaying multiple series, each contains 100+ data points I have a UI containing a checkbox for each series that when clicked calls the series.hide() or series.show() to toggle the hide/show of each line My problem is that the hide and show are extremely slow such that I cant check one checkbox whilst processing from a previous is taking place Does anyone know how to handle this? Thanks

4

3 回答 3

13

而不是调用hide()每个系列,调用setVisible(false, false);. 这第二个参数是redraw参数,可以避免对每个系列造成重绘(很慢)。

然后,在您完成更改可见性后,调用chart.redraw() 一次

http://api.highcharts.com/highcharts#Series.setVisible

于 2014-08-19T01:31:52.623 回答
2

如回答:

在 Highcharts 和 jQuery 中隐藏系列的_groups_:如何获得可接受的性能?

  • 每次调用 show 或 hide 时都会绘制 highcharts;
  • 禁用和启用重绘功能对我有用;

    var _redraw = this.chart.redraw;
    this.chart.redraw = function(){};
    
    //do work
    
    this.chart.redraw = _redraw;
    this.chart.redraw();
    
于 2013-07-09T09:14:29.533 回答
0

visible: false在调用之前添加隐藏的系列怎么样Highcharts.chart()?请参阅参考资料:1. Highcharts API和 2. Demo

就我而言,与以下方法相比,上述方法显示出最佳性能:

  1. series.hide()
  2. setVisible(false, false)
  3. setVisible(false, true)或者setVisible(false, false); redraw();
于 2019-05-30T03:01:00.463 回答