当动态添加值时,Highcharts会保持缩放

时间:2018-06-18 18:04:59

标签: highcharts highstock

我厌倦了几天前遇到的一个问题,但仍然没有解决。我有一个包含两个系列的Highstock图表:

{
    rangeSelector: {
      buttons: [{
        type: 'day',
        count: 1,
        text: '1d'
      }, {
        type: 'week',
        count: 1,
        text: '1W'
      }, {
        type: 'month',
        count: 1,
        text: '1M'
      }, {
        type: 'all',
        count: 1,
        text: 'All'
      }],
      selected: 1,
      inputEnabled: false
    },
    legend: {
      useHTML: Highstock.hasBidiBug
    },
    series: [
      {
        name: 'MAX',
        data: this.chartData.maxValuesArr
      },
      {
        name: 'MIN',
        data: this.chartData.minValuesArr
      }]
  }

正如你所看到的,默认情况下我使用范围为一周,自2014年以来我从BE数组获得了1600个值并且它很好地显示了我在默认情况下的最后一周,但是,每30个我也有价格更新(更多/更少)秒,我已经尝试了很多方法来添加这些值,这样就不会破坏图表的规模! On the picture you can see that 18 of jule is bigger than other days and all it became like that because I added updated point to it.

问题是如何动态添加(更新)图表并且不打破规模。对于范围我使用按钮(见配置)这就是为什么我不能使用chart.setExtremes()

我会非常感激!

0 个答案:

没有答案