JavaScript ChartsInstallation

AG Charts is available for download from NPM, CDN or as a direct download, however, we strongly recommend using either NPM or CDN. When using NPM, you need to import the package and register the modules you want to use.

NPM Installation

Install the ag-charts-community package:

npm install ag-charts-community
yarn add ag-charts-community

To use AG Charts Enterprise features, install the ag-charts-enterprise package:

npm install ag-charts-enterprise
yarn add ag-charts-enterprise

You can test AG Charts Enterprise locally without a licence. To test in production, access support and remove the watermark & console warnings, request a trial licence.

Importing

To use AG Charts Community features, import them from the ag-charts-community package, e.g:

import { AgCharts } from 'ag-charts-community';

To use AG Charts Enterprise features, import the ag-charts-enterprise package:

import 'ag-charts-enterprise';

See the Installing Enterprise Licence Key docs for more information on how to install your Enterprise or Trial licence key.

Accessing AG Charts

To use AG Charts in your JavaScript application, use the create API to create a chart with your chart options:

// Chart Options
const options = {...};

// Create Chart
const chart = AgCharts.create(options);

CDN Installation

To install AG Charts Community, include the following script tags in your HTML file:

<script src="https://cdn.jsdelivr.net/npm/ag-charts-community@11.1.0/dist/umd/ag-charts-community.min.js"></script>

To install AG Charts Enterprise, include the following script tags in your HTML file:

<script src="https://cdn.jsdelivr.net/npm/ag-charts-enterprise@11.1.0/dist/umd/ag-charts-enterprise.min.js"></script>

Once installed, you can then access AG Charts via the agCharts.AgCharts global variable. See the Quick Start for more information.

Download

If your project does not use package manager and you don't want to refer AG Charts from CDN, you can download AG Chart's source files and keep them in your project structure.

Downloading AG Charts makes upgrading more complex and prone to errors. We recommend using AG Charts from an NPM/Yarn package or from CDN.

You can download AG Charts Community from the GitHub Repository.

You can download AG Charts Enterprise from the GitHub Repository.

After downloading the bundles, you can refer to the files in the same way as you would from CDN. See the Quick Start for more information.