Following the react-chartjs-2 documentation and setting up a Pie chart on codesandbox gets everything working, except the options don't work.
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.
I've made ademo , which can be forked to keep all of the dependencies. It also demos a few options that can be adjusted on the chart.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.