'Sheets apps script ComboChart.modify() not working - causes forever "reload" dialog
I made sheets stock sheet that downloads daily single stock history (csv) from Yahoo and then charts hi/low/close using a combo chart. The chart left axis was rescaled by small apps script that read 2 cells and modified vAxes... and then chart.modify(). This has been working for over 12 months without any changes or problems. Then, during week of 5/15/22, the sheet complained "Something went wrong - reload" rapidly and repeatedly at startup. Problem was traced to chart.modify() for Combo charts only - line and column charts don't have problem.
function yAxis0Rescale() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var minVal = sheet.getRange('A20').getValue();
var maxVal = sheet.getRange('A21').getValue();
var vAxisOptions = { minValue: minVal, maxValue: maxVal }
var newChart = sheet.getCharts()[0].modify().setOption('vAxes.0',vAxisOptions).build();
sheet.updateChart(newChart);
}
for debugging, I reduced the script actions to just .modify() (no rescaling) and determined that .modify() was the problem. Is there a fix or work around for combo charts modify()? This script worked perfectly for more than 12 months. I would really like to get this working again.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
