2017-07-25 79 views
0

我使用highcharts映射这样JSFiddle
的问题深入分析是,当我钻到,我改变这样Highcharts追溯失败

chart.update({ 
    colorAxis: { 
     dataClasses: [{ 
      to: 5000 
     }, { 
      from: 5000, 
      to: 6000 
     }, { 
      from: 6000 
     }] 
    } 
}); 

的数据类和它完美的作品,当我drillUp我有这个

drillup: function() { 
    this.setTitle(null, { text: 'General' }); 
    this.colorAxis[0].update({ 
     colorAxis: { 
      dataClasses: [{ 
       to: 200000 
      }, { 
       from: 200000, 
       to: 350000 
      }, { 
       from: 350000 
      }] 
     } 
    }); 
} 

所有的作品完美,但是当我尝试再次钻取它不起作用。 有什么想法来解决这个问题?或者如何以不同的方式更改数据类?

回答

0

我得到了想要的结果只是加入 “假” 来Highcharts的重绘选项,因为它是默认设置为true

update(Object options, Boolean redraw)

我不得不阅读文档。这里是docs的答案。我正在使用Highcharts JS v5.0.12 (2017-05-24)

下面是代码

drillup: function() { 
    this.update({ 
     colorAxis: { 
      dataClasses: [{ 
       to: 200000 
      }, { 
       from: 200000, 
       to: 350000 
      }, { 
       from: 350000 
      }] 
     } 
    }, false); 
}