I'm trying to add more vertical gridlines to a dual-x chart (see attached 
image for visual of what I'm doing). However, the chart is only showing the 
default gridlines (which at a width of 450px shows a 0 - 50% - 100%) and I 
would like it to have the following gridlines: 1 - 25% - 50% - 75% - 100%.

Does anyone know why the following code doesn't work? The hAxis.percent 
works, but neither of the other hAxis configuration options to add the 
extra gridlines are working. 

Thanks for any insight you can provide!

*My HTML*
Head:   
<script type="text/javascript" src="https://www.google.com/jsapi";></script>

Body:    
<div id="table_chart" style="width: 450px; height: 400px;"></div>


*My JavaScript*
google.load("visualization", "1.1", {packages:["bar"]});
google.setOnLoadCallback(drawChart);


function drawChart() {
  var data = new google.visualization.arrayToDataTable([
      ['Market Share', 'New', 'Used'],
      ['Agriculture', .35, .32],
      ['Industry', .24, .13]
  ]);


  var options = {
      chart: {
        title: '',
        subtitle: ''
      },
      bars: 'horizontal',
      axes: {
        y: {
          0: {side: 'right'}
        }
      },
      legend: {position: 'none'},
      colors: ['#0a8b00', '#8ecb89'],
      hAxis: {
        format: 'percent',
        gridlines: {count: 4},
        ticks: [.25,.5,.75,1]
      }
  };

  var chart = new google.charts.Bar(document.getElementById('table_chart'));
  chart.draw(data, google.charts.Bar.convertOptions(options));
};

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to