I need help with making my Google Sheets line chart automatically fit the Y-axis range to my data values. I tried using some methods I found online but they don’t seem to work properly.
I’m getting an error when trying to use certain chart builder methods in Google Apps Script. The error message says there’s an issue with accessing chart properties.
My dataset contains time series data that looks like this:
The problem is that the chart shows a huge range on the vertical axis instead of zooming in close to my actual data points. I want the axis to start just below my minimum value and end just above my maximum value.
I also tried adding dummy data points above and below my range but that didn’t work either. Is there a way to make Google Sheets charts automatically scale the Y-axis tightly around the data?
Been fighting chart scaling issues for years. Manual adjustments work until your data changes, then they break.
Just automate it. I built a workflow that watches my Google Sheets and recalculates Y-axis bounds whenever new data hits.
Here’s how: connect your sheet to something that reads your data range, calculates MIN/MAX with padding (I use 5% buffer), then pushes those values back to your chart config. No more manual fixes every time your dataset updates.
Perfect for time series since it recalculates bounds from actual data instead of fixed ranges. You can even set different padding rules per chart type.
I use Latenode - connects straight to Google Sheets API and handles chart updates. Takes 10 minutes to set up, then it’s hands-off.
right click on the y-axis & choose “format axis” - that menu has options not in chart editor. also, make sure no empty cells are in your data range since they can mess up scaling. pro tip: try using =MIN(B:B)*0.95 for min value so it auto-adjusts!
I experienced a similar problem recently, and I found a solution that worked without using Apps Script, which can often be unreliable. Instead, you can directly modify the vertical axis settings in the chart editor. Click on the three dots on your chart to access “Edit chart,” navigate to Customize, and then select Vertical axis. Here, you can manually set the Min and Max values. It’s best to enter a value just below your minimum data point and one just above your maximum. If you want these values to adjust dynamically as your data changes, you can use the MIN() and MAX() functions in reference to your dataset and adjust them accordingly for better accuracy.