ApexCharts

5.10.6 · active · verified Sun Apr 19

ApexCharts is a modern, open-source JavaScript charting library for building interactive data visualizations. It provides a wide array of over a dozen chart types, offering responsive and feature-rich charts suitable for applications and dashboards. The current stable version is 5.10.6, with frequent patch releases addressing bugs and introducing minor features, sometimes on a weekly or bi-weekly cadence. Key differentiators include its extensive chart catalogue, built-in server-side rendering (SSR) support, modular entry points for efficient tree-shaking, and accessibility features like color-blind modes. It also offers official wrappers for popular frameworks like React, Vue, and Angular, simplifying integration into various web environments.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart code initializes and renders a basic bar chart using ApexCharts in a client-side browser environment, demonstrating chart creation with minimal configuration.

import ApexCharts from 'apexcharts';

const chartElement = document.querySelector('#chart');

const options = {
  chart: {
    type: 'bar',
    height: 350
  },
  series: [
    {
      name: 'sales',
      data: [30, 40, 35, 50, 49, 60, 70, 91, 125]
    }
  ],
  xaxis: {
    categories: [1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999]
  },
  title: {
    text: 'Basic Bar Chart Example',
    align: 'left'
  }
};

if (chartElement) {
  const chart = new ApexCharts(chartElement, options);
  chart.render();
} else {
  console.error('Chart element with id "#chart" not found.');
}

// Example of updating series data (requires a chart instance already rendered)
// setTimeout(() => {
//   chart.updateSeries([{ data: [20, 50, 45, 30, 70, 55, 80, 100, 110] }]);
// }, 5000);

view raw JSON →