0

当使用带有堆积条形图并启用滚动条的 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'”错误”

4

1 回答 1

-1

它在您设置cropThreshold 参数时起作用。

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

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

于 2018-03-02T12:56:14.450 回答