HighChart堆积条形图滚动条问题

问题描述 投票:0回答:1

当使用带有堆积条形图和滚动条的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()
    }
  ]
});

当我滚动回到初始位置时,我收到此错误“无法读取属性'0'未定义”错误,当堆积柱形图调整大小时“

highcharts highstock angular2-highcharts
1个回答
-1
投票

它设置cropThreshold参数时有效。

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

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

© www.soinside.com 2019 - 2024. All rights reserved.