---
title: "Download"
framework: angular
version: "14.1.0"
---

# Download

Saving chart images by API call.

## Download API

We expose the APIs for triggering download via the `AgCharts` class:

| Property | Type | Default | Description |
| --- | --- | --- | --- |
| download | Function |  | Starts a browser-based image download for the given `AgChartInstance`.  Returns a `Promise` that resolves once the download has been initiated. |
| getImageDataURL | Function |  | Returns a base64-encoded image data URL for the given `AgChartInstance`. |

The `AgChartInstance` can be obtained using an Angular `@ViewChild` decorator to reference our `AgCharts` tag, which exposes a `chart` property.

This example demonstrates:

- How to obtain a reference to an `AgChartInstance`.
- How to use `AgChartInstance.download()` to start a chart image download.
- How to use `AgChartInstance.getImageDataURL()` to create a base64-encoded image URL, and then open it in a new tab.

#### Download via AgChartInstance API

```ts
// Angular entry point file
import '@angular/compiler';
import { bootstrapApplication } from '@angular/platform-browser';

import { AppComponent } from './app.component';

bootstrapApplication(AppComponent);
```

[Live example: Download via AgChartInstance API](https://www.ag-grid.com/charts/angular/api-download/examples/download)
