title: How do you add a range to the X-Axis in a chart in google sheets via Apps Script
body: <p>I'm fairly new to Apps Script but familiar with javascript. I've taken a look at the reference guide that's given for sheets but I might be missing it or not sure what I'm looking for. If you insert a regular line chart manually, you have an option to add a range for the X-Axis from selected cells. How would you do this via script? I have this set up so far</p>
  
  <pre><code>function BuildOChart(x){
    var chart = sheet.newChart().asLineChart()
    chart.setChartType(Charts.ChartType.LINE)
    chart.addRange(sheet.getRange(x))
    chart.setCurveStyle(Charts.CurveStyle.SMOOTH)
    chart.setPosition(5, 5, 0, 0)
    chart.setOption("X-Axis", "H1:H100") //Doesn't work
    sheet.insertChart(chart.build())
  }
  </code></pre>