Build a Chart from a Data Range
A 5-step recipe with Microsoft Excel. We can help you get access.
Recipe · 5 steps
Build a Chart from a Data Range
with Microsoft Excel
Create a chart over a verified source range and confirm it was added.
- Open a persisting session so the created chart is saved to the stored workbook.
- Read the source range before charting it. A chart built over an empty or wrongly sized range renders blank, and this read catches that early.
- List the charts already on the worksheet so a repeated run can be recognised instead of stacking a second chart on top of the first.
- Create the chart over the verified range. seriesby Auto lets Excel decide whether the series run by row or by column based on the range shape.
- List the charts again to confirm the new chart is present on the sheet and to hand the caller the full chart set with positions.
What you'll need to have ready
- itemId: The drive item id of the workbook file.
- worksheetIdOrName: The worksheet the chart is drawn on.
- sourceData: The A1-notation range the chart plots, including the header row (e.g. "A1:C4").
- chartType: The Excel chart type to create (e.g. "ColumnClustered", "Line", "Pie").
For your developer
Arazzo workflow microsoft-excel:build-chart-from-range, 5 operations: createWorkbookSession → getRange → listCharts → addChart → listCharts. Specs on APIs.io.