2

I am using Google charts and reading about the axis customization instructions here. Here are two examples of charts that the code below is generating:

Example 1:

enter image description here

Example 2:

enter image description here

And the code (note that the dataTableArray raw values have been taken out):

<div class="w600" style="height: 400px;" id="chart_div"></div>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script>
google.charts.load('current', { packages: ['corechart', 'bar'] });
google.charts.setOnLoadCallback(drawMaterial);

function drawMaterial() {
    var data = google.visualization.arrayToDataTable(dataTableArray);

    var materialOptions = {
        hAxis: {
            title: 'Count',
            minValue: 0
        },
        vAxis: {
            title: 'Month',
            minValue: 0,
            viewWindowMode: 'explicit',
            viewWindow: {
                min: 0,
                max: 100
            },
            gridlines: {
                count: 1,
            }
        },
        bars: 'vertical'
    };
    var materialChart = new google.charts.Bar(document.getElementById('chart_div'));
    materialChart.draw(data, materialOptions);
}
</script>

According to my understanding, the code above should force the graphs to increment by 1 (the gridlines.count variable) and the highest gridline should be 100. However, this isn't happening.

My questions: How can I make the gridlines increment by 1? And how can I set a max width for the bar on the second graph?

aBlaze
  • 2,436
  • 2
  • 31
  • 63
  • 1
    it appears you are using a material chart, there are several options that are not supported by material charts, see --> [issue #: 2143](https://github.com/google/google-visualization-issues/issues/2143) – WhiteHat Sep 07 '18 at 15:02

0 Answers0