
Modern, interactive JavaScript charts your users will love, built for dashboards, SaaS, and data-heavy UIs.
Live demos · Documentation · License
## Why ApexCharts - **18+ chart types**: line, area, bar, column, pie, donut, radar, heatmap, treemap, candlestick, boxplot, funnel, pyramid, gauge and more in the default bundle, with unit (dot / pictogram / waffle / beeswarm), violin, sunburst, icicle, waterfall, dumbbell, streamgraph and raincloud one import away - **SSR support** for Next.js, Nuxt, SvelteKit, Astro, and other meta-frameworks: render real SVG on the server, hydrate on the client - **Tree-shakable**: import only the chart types and features you need; typical bundles are 30-60% smaller than the default bundle - **TypeScript-first**: full type definitions ship with the package, no `@types/*` install needed - **Zero runtime dependencies**: no React/Vue/D3 required; works in any framework or vanilla JS - **Accessibility**: keyboard navigation and ARIA support built in - **Free for most users**: see [License](#license) ## New in v6 Version 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. - **Plugin platform**: publish reusable chart plugins to npm against a stable, versioned API. `ApexCharts.registerPlugin(def)`, then activate per chart with `plugins: [{ name }]`. - **Canvas rendering for dense series**: `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. - **Undo / redo**: `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. - **Shareable view state**: `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. - **Design tokens and OS-aware themes**: define `--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. - **Custom series types**: `ApexCharts.registerSeriesType(name, { renderItem })` draws primitives per datum and inherits tooltips, events, legend, and keyboard navigation for free. - **Native-feeling touch**: two-finger pinch-zoom, two-finger pan, and kinetic inertia with axis rails, on by default. - **Pluggable easing**: `chart.animations.easing` accepts named curves, cubic-bezier arrays, or functions; add your own with `ApexCharts.registerEasing`. - **Coherent data transitions**: updates that add or remove data points animate as one coordinated motion. New bars grow from the baseline, removed ones shrink away, line and area fills reshape without tearing, and markers, bubbles, and axis labels ride along. On by default for animated charts. - **Crossfilter dashboards**: link charts into a shared filter engine with `ApexCharts.crossfilter`. Click a slice or brush a range in one chart and every linked chart filters to match. - **Annotation authoring**: `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. - **Measure ruler**: hold a key and drag to read the change, percent, and slope between two points; pinned rulers re-project on zoom and resize (`chart.measure`). - **Context menu**: right-click or long-press a data point for actions that operate at that exact point, with custom items supported (`chart.contextMenu`). - **Real-time streaming**: rolling-window updates scroll at constant velocity instead of warping in place, and `chart.streaming` bounds memory for long-running feeds. - **Scrollytelling**: `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. ## Install ```bash npm install apexcharts ``` Or from a CDN, pinned to a release: ```html ``` A pinned page keeps working when a new major changes what the default bundle holds. The unversioned `https://cdn.jsdelivr.net/npm/apexcharts` always serves the newest release, the next major included. ## Quick start ```js 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](https://apexcharts.com/javascript-chart-demos/): copy, paste, ship. ## Chart types - [Line](https://apexcharts.com/javascript-chart-demos/line-charts/) · [Area](https://apexcharts.com/javascript-chart-demos/area-charts/) · [Range Area](https://apexcharts.com/javascript-chart-demos/range-area-charts/) - [Bar](https://apexcharts.com/javascript-chart-demos/bar-charts/) · [Column](https://apexcharts.com/javascript-chart-demos/column-charts/) · [Range Bar / Timeline](https://apexcharts.com/javascript-chart-demos/timeline-charts/) - [Scatter](https://apexcharts.com/javascript-chart-demos/scatter-charts/) · [Bubble](https://apexcharts.com/javascript-chart-demos/bubble-charts/) - [Candlestick](https://apexcharts.com/javascript-chart-demos/candlestick-charts/) · [BoxPlot](https://apexcharts.com/javascript-chart-demos/boxplot-charts/) · [Violin](samples/vanilla-js/violin/) - [Pie](https://apexcharts.com/javascript-chart-demos/pie-charts/) · [Donut](https://apexcharts.com/javascript-chart-demos/pie-charts/) · [Polar Area](https://apexcharts.com/javascript-chart-demos/polar-area-charts/) · [Radial Bar / Gauge](https://apexcharts.com/javascript-chart-demos/radialbar-charts/) - [Radar](https://apexcharts.com/javascript-chart-demos/radar-charts/) · [Heatmap](https://apexcharts.com/javascript-chart-demos/heatmap-charts/) · [Treemap](https://apexcharts.com/javascript-chart-demos/treemap-charts/) - [Funnel](https://apexcharts.com/javascript-chart-demos/funnel-charts/) - [Unit / Pictogram / Beeswarm](samples/vanilla-js/unit/) · [Waffle](samples/vanilla-js/waffle/) (premium) · [shape kit](#shapes-for-the-unit-chart) Combine any of the above as [mixed/combo charts](https://apexcharts.com/javascript-chart-demos/mixed-charts/), [stacked variants](https://apexcharts.com/javascript-chart-demos/column-charts/stacked/), [sparklines](https://apexcharts.com/javascript-chart-demos/sparklines/), or [synchronized multi-chart layouts](https://apexcharts.com/javascript-chart-demos/line-charts/syncing-charts/). ## Framework wrappers Official: - **React**: [react-apexcharts](https://github.com/apexcharts/react-apexcharts) - **Vue 3**: [vue3-apexcharts](https://github.com/apexcharts/vue3-apexcharts) - **Vue 2**: [vue-apexcharts](https://github.com/apexcharts/vue-apexcharts) - **Angular**: [ng-apexcharts](https://github.com/apexcharts/ng-apexcharts) - **Blazor**: [Blazor-ApexCharts](https://github.com/apexcharts/Blazor-ApexCharts) - **Stencil**: [stencil-apexcharts](https://github.com/apexcharts/stencil-apexcharts) Community: - **Svelte**: [svelte-apexcharts](https://github.com/galkatz373/svelte-apexcharts) - **Ruby**: [apexcharts.rb](https://github.com/styd/apexcharts.rb) - **Laravel**: [larapex-charts](https://github.com/ArielMejiaDev/larapex-charts) - **R**: [apexcharter](https://github.com/dreamRs/apexcharter) ## Server-side rendering Render chart HTML on the server, then hydrate in the browser. Works with Next.js, Nuxt, SvelteKit, Astro, Remix, and any Node-based framework. ```js // 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 and the legend ``` `ApexCharts.renderToString()` returns the bare SVG instead, for images, email or PDF. The legend is HTML beside the chart, so that SVG has no legend. ```js // 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. ## Tree-shaking: ship only what you use `import ApexCharts from 'apexcharts'` gives you the standard chart types and the everyday features. The rest ship outside it and are imported explicitly (marked **opt-in** below); a chart that asks for one that is absent logs a console line naming the import. Adding one to the default bundle is a single line, and the two share one copy of the core: ```js import ApexCharts from 'apexcharts' import 'apexcharts/sunburst' import 'apexcharts/features/trellis' ``` Or take everything at once, every chart type and feature: ```js import ApexCharts from 'apexcharts/full' ``` | Outside the default bundle | Bundler | Script tag (after the ApexCharts script) | |---|---|---| | unit (and waffle, beeswarm) | `apexcharts/unit` | `dist/unit.js` | | sunburst | `apexcharts/sunburst` | `dist/sunburst.js` | | violin | `apexcharts/violin` | `dist/violin.js` | | icicle | `apexcharts/icicle` | `dist/icicle.js` | | raincloud | `apexcharts/raincloud` | `dist/violin.js`, then `dist/features/raincloud.js` | | waterfall, dumbbell, streamgraph | `apexcharts/features/waterfall` (and so on) | `dist/features/waterfall.js` (and so on) | | drilldown | `apexcharts/features/drilldown` | `dist/features/drilldown.js` | | trellis, measure, link, ink, storyboard, perspectives, history, context-menu, highlight-filter, renderer-canvas | `apexcharts/features/