Chartjs-How to set up a simple pie chart using React in ChartJS on codesandbox

1👍

When you set up react-chartjs-2 with import { Pie } from "react-chartjs-2";, codesandbox will automatically save the latest stable release of react-chartjs-2 and chart.js as dependencies. This unfortunately breaks things. You need to change the versions in this panel on the left hand side of your codesandbox panels.

enter image description here

I’ve made a demo, which can be forked to keep all of the dependencies. It also demos a few options that can be adjusted on the chart.

Leave a comment