0

Following the react-chartjs-2 documentation and setting up a Pie chart on codesandbox gets everything working, except the options don't work.

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.