---
title: React Chart.js Component
name: Chart
description: React wrapper for Chart.js 4.x, the most popular charting library.
route: /components/chart/
---

## Installation

If you want to use our Chart.js React wrapper you have to install an additional package.

### Npm

```bash
npm install @coreui/react-chartjs
```

### Yarn

```bash
yarn add @coreui/react-chartjs
```

## Chart Types

### Line Chart

A line chart is a way of plotting data points on a line. Often, it is used to show trend data, or the comparison of two data sets.
[Line Chart properties](https://www.chartjs.org/docs/latest/charts/line.html#dataset-properties)

<ExampleSnippet component="ChartLineExample" componentName="React Chart" />

### Bar Chart

A bar chart provides a way of showing data values represented as vertical bars. It is sometimes used to show trend data, and the comparison of multiple data sets side by side. [Bar Chart properties](https://www.chartjs.org/docs/latest/charts/bar.html#dataset-properties)

<ExampleSnippet component="ChartBarExample" componentName="React Chart" />

### Radar Chart

A radar chart is a way of showing multiple data points and the variation between them. They are often useful for comparing the points of two or more different data sets. [Radar Chart properties](https://www.chartjs.org/docs/latest/charts/radar.html#dataset-properties)

<ExampleSnippet component="ChartRadarExample" componentName="React Chart" />

### Doughnut and Pie Charts

Pie and doughnut charts are probably the most commonly used charts. They are divided into segments, the arc of each segment shows the proportional value of each piece of data. [Doughnut and Pie Charts properties](https://www.chartjs.org/docs/latest/charts/doughnut.html#dataset-properties)

<ExampleSnippet component="ChartDoughnutAndPieExample" componentName="React Chart" />

### Polar Area Chart

Polar area charts are similar to pie charts, but each segment has the same angle - the radius of the segment differs depending on the value. [Polar Area Chart properties](https://www.chartjs.org/docs/latest/charts/polar.html#dataset-properties)

<ExampleSnippet component="ChartPolarAreaExample" componentName="React Chart" />

### Bubble Chart

A bubble chart is used to display three dimensions of data at the same time. The location of the bubble is determined by the first two dimensions and the corresponding horizontal and vertical axes. The third dimension is represented by the size of the individual bubbles. [Bubble Chart properties](https://www.chartjs.org/docs/latest/charts/bubble.html#dataset-properties)

<ExampleSnippet component="ChartBubbleExample" componentName="React Chart" />

### Scatter Chart

A bubble chart is used to display three dimensions of data at the same time. The location of the bubble is determined by the first two dimensions and the corresponding horizontal and vertical axes. The third dimension is represented by the size of the individual bubbles. [Scatter Chart properties](https://www.chartjs.org/docs/latest/charts/scatter.html#dataset-properties)

<ExampleSnippet component="ChartScatterExample" componentName="React Chart" />

## API

Check out the documentation below for a comprehensive guide to all the props you can use with the components mentioned here.

- [&lt;CChart /&gt;](./api/#cchart)
