title: Apps Script Histogram Chart Builder Set Max Value
body: <p>I'm trying to build a Histogram chart in Apps script.  I am able to set the title and bucket size and get everything else working but no matter what I try I can not get the max and min range of the h-axis to set.  Code is attached below, when run the chart just has auto set for both max and min.  You will see that I have some code commented out as I have tried a range of different ways and none seem to work. </p>
  
  <pre><code>function buildHistogramChart() {
    var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
    var sheet = spreadsheet.getActiveSheet();
    var nameRange = sheet.getRange(2, 2, 3);
    var dataRange = sheet.getRange(2, 5, 3);
  
    var chartBuilder = sheet.newChart();
    chartBuilder.addRange(nameRange)
      .addRange(dataRange)
      .setChartType(Charts.ChartType.HISTOGRAM)
      .setOption('title', 'Test')
      .asHistogramChart()
      .setRange(0, 1)
      .setOption('hAxis.viewWindowMode', 'explicit')
      .setOption('histogram', {bucketSize: 0.25})
      //.asHistogramChart()
      //.setOption('histogram', {maxValue:0})
  
      //.setOption('xAxis', {minValue: 0,
      //                     maxValue:1})
      //.setRange(0,1)
      //.setOption('xAxis',{viewWindowMode:'explicit',
      //                  viewWindow: {
      //                  max:1,
      //                  min:0}})
      .setPosition(1,6,1,1)
      .build();
  
    sheet.insertChart(chartBuilder.build());
  }
  </code></pre>
  
  <p>Any help would be much appreciated.  I have searched extensively on Google and Stack Overflow and can find no reason why at least one of my attempts is not working.</p>
  
  <p>Kind Regards,</p>