I’m creating a Google spreadsheet and want to include a column chart with error bars. However, I’m unsure how to achieve this using the API. I have been using Python to generate my spreadsheets.
I’ve checked the documentation for BasicChartSpec and BasicChartSeries, but I couldn’t find any mention of how to enable error bars. Is this feature currently supported by the Google Sheets API, or is it a manual-only option?
If anyone has experience with adding error bars to charts through the API, I would greatly appreciate your insights or guidance. Thank you!
Hit this same wall about six months back while building automated dashboards. Google Sheets v4 API doesn’t support error bars, even though you can add them manually - classic API gap that drives you nuts. I ended up creating the base chart through the API, then used a hybrid approach where I’d add data programmatically but handle error bars through batch operations that mimicked manual steps. Not pretty, but it worked. You could also try Google Charts API directly if you need better charting features, though you’ll embed charts differently than native Sheets.
unfortunately, there’s no direct way to do this through the API right now. i tried this last month and had to get creative - ended up using conditonal formatting on my data ranges to fake error bar appearance. not perfect but clients didn’t notice the difference. google really needs to catch up their API features with what’s available in the UI.
Yeah, Google Sheets v4 API doesn’t support error bars for charts, which is annoying since you can add them manually in the UI. Hit this wall last year while automating financial reports that needed confidence intervals.
My workaround: add extra columns for upper and lower bounds, then create a combo chart - main data as columns and error ranges as line series with custom formatting. Not real error bars, but looks close enough.
Alternatively, export your data and use matplotlib or plotly in Python to make proper charts with error bars, then drop those images back into your sheets.