Set a Chart Data Source

Introduction

By default, chart data is placed in an Excel workbook. You can explicitly specify the data source for your chart data. Two options are available: Workbook and Literals. Storing data in the workbook means specifying the address of the first cell of the data range. Let’s say we want to store the series of four data points in the workbook cells B2:B5. In this case, “B2” is the first cell of the data range. Cell addresses are represented as row and column indexes, thus “B2” is row 1 and column 1 accordingly. Literals means storing values as is in the chart cache. The data source can be specified for series name, values, x-values, y-values, bubble sizes, and categories.

This article uses the CreateShape method described in Add a Shape to a Slide.

Workbook

Examples

The code examples below show how to create a ClustereColumn chart, and explicitly specify data allocation in the workbook.

cURL Example

SDK Examples

Literals

Examples

The code examples below show how to create a ClustereColumn chart using literals as a data source.

cURL Example

SDK Examples

SDKs

Check Available SDKs to learn how to add an SDK to your project.