README.md
<a href="https://github.com/apexcharts/apexcharts.js/blob/main/LICENSE"></a> <a href="https://www.jsdelivr.com/package/npm/apexcharts"></a>
</p> <p align="center"> <a href="https://apexcharts.com/demos/">Live demos</a> · <a href="https://apexcharts.com/docs/">Documentation</a> · <a href="#license">License</a> </p> <p align="center"><a href="https://apexcharts.com/javascript-chart-demos/"></a></p>@types/* install neededVersion 6 turns a chart from a picture you look at into a surface you investigate, author, and share. Most features below are opt-in and tree-shakeable; existing configs keep working unchanged.
ApexCharts.registerPlugin(def), then activate per chart with plugins: [{ name }].chart: { renderer: 'auto' } paints the series layer to canvas above a point threshold while axes, tooltips, annotations, and exports stay SVG. Hundreds of thousands of points, same config.chart: { history: { enabled: true } } records zooms, series toggles, option changes, and annotation edits. Ctrl-Z just works, and chart.history exposes undo, redo, jump, and transactions.chart.perspectives.capture() serializes the exact view (zoom window, hidden series, selections, annotations, theme) into a compact token you can put in a URL and restore anywhere.--apx-* CSS custom properties once and every chart reads them; theme: { follow: 'os' } tracks the system light/dark preference with zero JS, and ApexCharts.registerTheme registers named brand themes.ApexCharts.registerSeriesType(name, { renderItem }) draws primitives per datum and inherits tooltips, events, legend, and keyboard navigation for free.chart.animations.easing accepts named curves, cubic-bezier arrays, or functions; add your own with ApexCharts.registerEasing.ApexCharts.crossfilter. Click a slice or brush a range in one chart and every linked chart filters to match.chart: { ink: { enabled: true } } makes annotations draggable and resizable, adds click-to-create, snap, and a floating editor card (rename, recolor, restyle, delete), all wired into undo.chart.measure).chart.contextMenu).chart.streaming bounds memory for long-running feeds.chart.storyboard.bind({ beats }) pairs prose sections with saved chart views; the chart morphs to each view as the reader scrolls and reverses when they scroll back.npm install apexcharts
Or via CDN:
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
import ApexCharts from 'apexcharts'
const chart = new ApexCharts(document.querySelector('#chart'), {
chart: { type: 'bar' },
series: [{ name: 'Sales', data: [30, 40, 35, 50, 49, 60, 70, 91, 125] }],
xaxis: { categories: [1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999] }
})
chart.render()
Browse 100+ ready-to-use samples: copy, paste, ship.
Combine any of the above as mixed/combo charts, stacked variants, sparklines, or synchronized multi-chart layouts.
Official:
Community:
Render chart HTML on the server, then hydrate in the browser. Works with Next.js, Nuxt, SvelteKit, Astro, Remix, and any Node-based framework.
// Server
import ApexCharts from 'apexcharts/ssr'
const chartHTML = await ApexCharts.renderToHTML({
chart: { type: 'bar' },
series: [{ data: [30, 40, 35, 50, 49, 60, 70, 91, 125] }],
xaxis: { categories: [1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999] }
}, { width: 500, height: 300 })
// Returns hydration-ready HTML with embedded SVG
// Client
import ApexCharts from 'apexcharts/client'
ApexCharts.hydrate(document.getElementById('my-chart'))
// or: ApexCharts.hydrateAll()
No more dynamic(() => import(...), { ssr: false }) workarounds: the chart renders on the server and becomes interactive on hydration.
By default import ApexCharts from 'apexcharts' includes everything. For smaller bundles, import from apexcharts/core and add only what you need:
import ApexCharts from 'apexcharts/core' // bare class: no chart types, no features
// Chart types (match the value of chart.type)
import 'apexcharts/line'
import 'apexcharts/bar'
// import 'apexcharts/area'
// import 'apexcharts/scatter'
// Optional features
import 'apexcharts/features/legend'
import 'apexcharts/features/toolbar' // zoom/pan toolbar
// import 'apexcharts/features/exports' // SVG/PNG/CSV download
// import 'apexcharts/features/annotations'
// import 'apexcharts/features/keyboard' // keyboard navigation
// import 'apexcharts/features/drilldown' // hierarchical drill-down
// import 'apexcharts/features/morph' // animated chart-type morphs
// import 'apexcharts/features/history' // undo/redo (premium)
// import 'apexcharts/features/perspectives' // shareable view state (premium)
// import 'apexcharts/features/storyboard' // scrollytelling, incl. perspectives (premium)
// import 'apexcharts/features/facet' // design tokens + OS themes
// import 'apexcharts/features/weave' // plugin platform
// import 'apexcharts/features/marks' // custom series types
// import 'apexcharts/features/link' // crossfilter / linked views (premium)
// import 'apexcharts/features/ink' // on-chart annotation editing (premium)
// import 'apexcharts/features/measure' // measure/delta ruler (premium)
// import 'apexcharts/features/context-menu' // right-click context menu (premium)
// import 'apexcharts/features/renderer-canvas' // canvas series renderer
See the tree-shaking guide for the complete list of entry points.
Most of ApexCharts is free and open source. A small set of advanced features are premium and require a license key:
| Feature | Enabled by |
|---|---|
| Storyboard (scrollytelling) | chart.storyboard.bind(...) |
| Linked views / crossfilter | chart.link.enabled / chart.link.dimension / ApexCharts.crossfilter() |
| Ink layer (on-chart annotation editing) | chart.ink.enabled |
| Measure / delta ruler | chart.measure.enabled |
| Context menu (right-click) | chart.contextMenu.enabled |
| Perspectives (shareable view state) | chart.perspectives.apply() / .save() / ApexCharts.perspectives.decode() |
| History (undo/redo) | chart.history.enabled |
Without a valid key these features still work (trial mode), but the chart shows an "APEXCHARTS" watermark. A valid key removes it. Everything else, including every chart type and all other features, is free and never watermarked.
import ApexCharts from 'apexcharts'
// Set once, before rendering. Applies to every chart on the page.
ApexCharts.setLicense('APEX-xxxxxxxx')
Alternatives to setLicense:
// Global variable (used when setLicense was not called):
window.Apex = { license: 'APEX-xxxxxxxx' }
// Per-chart override (most specific wins):
new ApexCharts(el, { chart: { license: 'APEX-xxxxxxxx' /* ... */ } })
Precedence per chart: chart.license -> ApexCharts.setLicense() -> window.Apex.license -> unlicensed (trial). The watermark is re-evaluated on every render, so a late setLicense(validKey) followed by chart.update() clears it.
Keys are shared across the whole ApexCharts family (apexgantt, apextree, apexsankey, apex-grid-enterprise, apexstock), so one customer key works everywhere. Get a license at apexcharts.com/pricing.
ApexCharts works in all modern evergreen browsers (Chrome, Firefox, Safari, Edge). For server-side rendering, Node.js 18+ is required.
npm install
npm run dev # vite build --watch
npm test # e2e + unit
See CONTRIBUTING.md for setup, coding conventions, and PR guidelines.
ApexCharts uses a revenue-based license:
Full terms: apexcharts.com/license
We've partnered with Infragistics, creators of Ignite UI: high-performance data grids that handle unlimited rows and columns, with custom templates and real-time updates.
<p align="center"><a href="https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/grid" target="_blank"></a></p>Available for:
Angular · React · Blazor · Web Components · jQuery