React Chartjs 2 screenshot

React Chartjs 2

Author Avatar Theme by Reactchartjs
Updated: 27 Oct 2025
6902 Stars

React components for Chart.js, the most popular charting library

Categories

Overview

The React-Chartjs-2 library is a set of React components that provide integration with Chart.js, which is a popular charting library. With React-Chartjs-2, users can easily create interactive and visually appealing charts in their React applications. The library primarily supports Chart.js versions 4 and 3, and it can be installed via NPM.

Features

  • React Components: The library provides a set of reusable React components that allow users to easily incorporate charts into their React applications.
  • Chart.js Integration: React-Chartjs-2 seamlessly integrates with Chart.js, the go-to charting library for many developers, providing access to its extensive features and options.
  • Peer Dependencies: The library requires users to have Chart.js installed as a peer dependency, ensuring compatibility between the React components and the charting library.

Installation

To install the React-Chartjs-2 library, users can follow these steps:

  1. Make sure that Chart.js v4.0.0 or above is installed in the project:
npm install chart.js@^4.0.0
  1. Install the React-Chartjs-2 library using NPM:
npm install react-chartjs-2
  1. Import the desired chart components in the React application and use them as needed:
import { LineChart, BarChart } from 'react-chartjs-2';

function App() {
  return (
    <div>
      <LineChart data={chartData} options={chartOptions} />
      <BarChart data={chartData} options={chartOptions} />
    </div>
  );
}

Summary

The React-Chartjs-2 library provides React developers with a convenient way to integrate Chart.js into their applications. With its reusable components and seamless integration, developers can create visually appealing and interactive charts with ease. By following the installation guide, developers can quickly start using the library and take advantage of its features in their React projects. The library is licensed under the MIT license and is maintained by Jeremy Ayerst.