如果Y.axis相同,Highchart不显示行

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

我的高级图表仅在值不同时显示数据行,如果该值相同(如本示例1100),则仅显示1465数据(如点)。如果数据以连续方式具有相同的值,则问题出在Y.axis上。谢谢。Resulta image of highchart

$( document ).ready(function() {
      var datacharts = ["1100","1100","1100","1100","1100","1100","1100","1100","1100","1100",1465,"1100"];
      Highcharts.chart('container', {
        chart: {
          type: 'line',
          height:500,
          options3d: {
            enabled: true,
            alpha: 15,
            beta: -10,
            viewDistance: 180,
            depth: 100
          }
        },
          title: {
              text: 'Personne 1'
          },

        xAxis: {
          categories: ["mars","avril","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c.","janv.","f\u00e9vr."],
          labels: {
            skew3d: true,
            style: {
              fontSize: '16px'
            }
          }
        },

        yAxis: {
          allowDecimals: false,
          min: 800,
          color:'red',
          title: {
            text: 'Prime Par mois',
            skew3d: true
          }
        },


        plotOptions: {
          column: {
            stacking: 'normal',
            depth: 40
          }
        },

        series: [{
          name: 'Data',
          data: datacharts,
          color: '#0e9bb7'
        }]
      });
});
</script>
javascript php html highcharts
1个回答
0
投票

问题是您将数据作为字符串而不是数字进行传递。试试这个:

var datacharts = [1100,1100,1100,1100,1100,1100,1100,1100,1100,1100,1465,1100];

在您的示例中,1465是唯一不是字符串的字符串,因此,它在图表上表示出来。

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