1

Been running into a few issues when trying to maximize the field of view on a candlestick chart.

I basically want the smallest value in the range to be the lowest Y-axis value and the highest value in the range to be the highest Y-axis value.

I did some research and found the vAxis.viewWindowMode and "maximized" but can't seem to get it to work:

  var chart1 = sheet3.getCharts()[0];
  var chart1range = sheet2.getRange('D2:H102');
  //chart1range.setNumberFormat("#####.##") 
  
 
  chart1 = chart1.modify()
      .addRange(chart1range)
      .setOption('title', 'My Chart (0)')
      //.setOption("vAxes", {3000: {viewWindowMode: "maximized"}}) - This isnt working
      .setOption("vAxis.viewWindowMode", "maximized") - Or this
      .setPosition(1,1,0,0)
      .build();
  sheet3.updateChart(chart1);
  

If anyone can help that would be great.

Thanks.

  • Possible duplicate of [Google Apps Script: How to set "Use column A as labels" in chart embedded in spreadsheet?](https://stackoverflow.com/questions/13594839/google-apps-script-how-to-set-use-column-a-as-labels-in-chart-embedded-in-spr) – TheMaster Feb 26 '19 at 22:51

0 Answers0