HighChart堆积条形图滚动条问题

时间:2018-03-01 20:05:06

标签: highcharts highstock angular2-highcharts

当使用带有堆积条形图和滚动条的highstock时,它有100个类别,当我开始滚动时,我看不到图表上的数据。 它最多可以工作50个类别

https://jsfiddle.net/shashi3337/5xn92uht/1/

function test() {
  var data = [];
  for (var i = 0; i < 100; i++) {
    var value = Math.random() * 10;
    var x = {
      id: i,
      name: 'test ' + i,
      y: value
    }
    data.push(x);
  }
  return data;
}

$('#container').highcharts({
  chart: {
    type: 'column',
  },
  plotOptions: {
    column: {
      stacking: 'normal'
    },
  },
  xAxis: {
    type: 'category',
    max: 10
  },
  scrollbar: {
    enabled: true
  },
  series: [{
      name: "A",
      data: test()
    }, {
      name: "B",
      data: test()
    },
    {
      name: "C",
      data: test()
    },
    {
      name: "D",
      data: test()
    }
  ]
});

当我滚动回初始位置时,我收到此错误 &#34;无法阅读财产&#39; 0&#39;未定义&#34;堆积柱形图调整大小时的错误&#34;

1 个答案:

答案 0 :(得分:-1)

设置cropThreshold参数时可以正常工作。

plotOptions: {
    column: {
      stacking: 'normal',
      cropThreshold: 10000
    },
  }

https://jsfiddle.net/shashi3337/cbd39oLh/1/

相关问题