Get started with react-chartjs-2 CDN
MIT licensed
React-chartjs-2 is a popular React library for rendering interactive charts using Chart.js.
Tags:- chart
- chart-js
- chart.js
- react-chartjs-2
- react chart.js
Stable version
Copied!
How to start using react-chartjs-2 CDN
import React from 'react';
import { Bar } from 'react-chartjs-2';
const data = {
labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple'],
datasets: [
{
label: '# of Votes',
data: [12, 19, 3, 5, 2],
backgroundColor: 'rgba(255, 99, 122, 0.2)',
},
],
};
const options = {
scales: {
y: {
beginAtZero: true,
},
},
};
const Chart = () => {
return (
<div className="chart-container">
<Bar data={data} options={options} />
</div>
);
};
export default Chart;
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
All versions
1.0.0
1.1.0
1.1.1
1.1.2
1.1.3
1.1.4
1.1.5
1.1.6
1.1.7
1.2.0
1.2.1
1.2.2
1.2.3
1.2.4
1.2.5
1.2.6
1.2.7
1.2.8
1.2.9
1.3.0
1.4.0
1.4.1
1.5.0
1.5.1
1.5.2
1.5.3
1.5.4
1.5.5
1.5.6
1.6.0
1.6.1
1.6.2
2.0.0
2.0.5
2.1.0
2.10.0
2.11.1
2.11.2
2.3.0
2.4.0
2.4.1
2.5.0
2.5.1
2.5.2
2.5.3
2.5.4
2.5.5
2.5.6
2.5.7
2.5.8
2.6.0
2.6.1
2.6.2
2.6.4
2.7.0
2.7.1
2.7.2
2.7.3
2.7.4
2.7.6
2.8.0
2.9.0
3.0.0
3.0.1
3.0.2
3.0.3
3.0.4
3.0.5
3.1.0
3.1.1
3.2.0
3.3.0
4.0.0
4.0.1
4.1.0
4.2.0
4.3.0
4.3.1
5.0.0
5.0.1
5.1.0
*** 5.2.0