Highchart Y轴点未显示

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

[Y轴点之间的差异较大时,Highcharts不会渲染较小的点。

这里是一个例子:https://jsfiddle.net/Lnbz3wtx/1/

图表代码:

Highcharts.chart('container', {
    chart: {
        type: 'column'
    },
    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },

   /*  plotOptions: {
        series: {
            minPointLength: 2 // I've tried setting minPointLength but it shows even for 0 values
        }
    }, */

    series: [{
        data: [500, 1]
    }]
});
angular highcharts
1个回答
1
投票

而不是将数据值设置为0,您可以将nullminPointLength结合使用。

Highcharts.chart('container', {
  chart: {
    type: 'column'
  },
  xAxis: {
    categories:  ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
  },

  plotOptions: {
    series: {
      minPointLength: 3
    }
  },


  series: [{
    data: [500, 1, null, null, null, null, null, null, null, null, null, null]
  }]
});
<script src="https://code.highcharts.com/highcharts.js"></script>

<div id="container" style="height: 400px"></div>
© www.soinside.com 2019 - 2024. All rights reserved.