Import a Chart from an Excel Workbook
Contents
[
Hide
]
Introduction
Aspose.Slides Cloud API allows you to import a chart from an Excel workbook and insert it as a shape on a presentation slide. You can identify the chart by name or by its 1-based index within the worksheet. The workbook can be uploaded as a file or referenced by its path in the storage. To build charts programmatically from scratch instead, see the Create Charts section.
API Information
| API | Type | Description | Resource |
|---|---|---|---|
| /slides/{name}/slides/{slideIndex}/shapes/fromExcelChart | POST | Imports a chart from an Excel workbook and adds it to a slide. | ImportChartFromWorkbook |
Request Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| name | string | path | true | The name of a presentation file. |
| slideIndex | integer | path | true | The 1-based index of the target slide. |
| document | file | form | false | The Excel workbook to upload. Either document or workbookPath must be provided. |
| worksheetName | string | query | true | The name of the worksheet that contains the chart. |
| chartName | string | query | false | The name of the chart to import. Use either chartName or chartIndex. |
| chartIndex | integer | query | false | The 1-based index of the chart in the worksheet. Use either chartName or chartIndex. |
| x | number | query | false | The X coordinate of the chart shape on the slide, in points. |
| y | number | query | false | The Y coordinate of the chart shape on the slide, in points. |
| embedAllWorkbook | boolean | query | false | When true (default), the entire workbook is embedded in the shape. When false, only the chart data is embedded. |
| workbookPath | string | query | false | The path to the workbook file in the storage. Used instead of document when the file is already stored. |
| workbookStorage | string | query | false | The name of the storage containing workbookPath. |
| password | string | header | false | The password to open the presentation. |
| folder | string | query | false | The path to the folder containing the presentation. |
| storage | string | query | false | The name of the storage containing the folder. |
Example
Import the chart named “Sales Chart” from the “Revenue” worksheet in MyWorkbook.xlsx and add it to the first slide of MyPresentation.pptx at position (100, 100).
cURL Solution
SDK Solutions
SDKs
Check Available SDKs to learn how to add an SDK to your project.