谷歌图表未在轴上显示垂直线

时间:2021-05-27 11:01:48

标签: google-visualization

不知何故我的图表没有在上面显示轴线我怎样才能让它们显示,这是我下面的代码,我知道这个解决方案已经提出Google Chart: How to draw the vertical axis for LineChart?

但它与我的不同,因为我使用 ES6 扩展运算符...realYears”映射我的数据以动态访问我的数据

 var {{ place.id.toString() }}data = new google.visualization.arrayToDataTable([
    ['Year', 'Total People in IS', 'Backlog With Growth Rate', 'Backlog With Current Delivery Pace'],
    ...realYears]);

  var {{ place.id.toString() }}options = {
      title: '',
      lineWidth: 5,
      height: 330,
      width: 750,
      curveType: 'function',
      legend: {
        position: 'top',
        textStyle: { color: '#4A4A4A', 
                   fontName: 'Source Sans Pro', 
                   fontSize: '14' }
      },

      series: {
        0: {
          color: '#F85C59'
        },
        1: {
          color: '#FFAC55'
        },
        2: {
          color: '#38B99F'
        },
      },
      vAxis: {
        format:'0',
        basline: 0,
        gridlines: {
          color: 'transparent'
        },
        textStyle: { color: '#4A4A4A', 
                   fontName: 'Source Sans Pro', 
                   fontSize: '22' }
      },
      hAxis: {
        format:'0',
        baseline: 0,

        textStyle: { color: '#4A4A4A', 
                   fontName: 'Source Sans Pro', 
                   fontSize: '22' }
      },


      
    
    };

这就是我希望我的图表的样子

enter image description here

0 个答案:

没有答案