首页 > 解决方案 > 谷歌图表未在轴上显示垂直线

问题描述

不知何故,我的图表上没有显示轴线我怎样才能让它们显示,这是我下面的代码,我知道这个解决方案已经提出了谷歌图表:如何为 LineChart 绘制垂直轴?

但它与我的不同,因为我使用ES6 Spread 运算符...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' }
      },


      
    
    };

这就是我希望我的图表看起来的样子

在此处输入图像描述

标签: google-visualization

解决方案


推荐阅读