Skip to content

react-chartjs-2 v3.0.5 not recognizing the "cutout" property inside the config options for Doughnut chart #741

@georgewfsantos

Description

@georgewfsantos

Hello,
We are having an issue in our React application where cutout is not recognized as part of the config options for the Doughnut chart. The problem happened after the lib was upgraded to version 3.0.5 and we're using chart.js v3.5.1. We've tried a lot of things but the problem seems to be type related, since after adding " as any " to the config object inside the options prop, the problem disappears. I'm also attaching some screenshots below showing the error and that it disappears after typying the object as "any".Thank you in advance.
The code is as follows:

<Doughnut
              data={{
                labels: recognitionsByEvent.breakdown.map(
                  breakdown => breakdown.name,
                ),
                datasets: [
                  {
                    data: recognitionsByEvent.breakdown.map(
                      breakdown => breakdown.total,
                    ),
                    backgroundColor: getRandomColor(),
                  },
                ],
              }}
              height={200}
              options={{
                maintainAspectRatio: false,
                responsive: true,
                cutout: '75%',
                plugins: {
                  legend: { display: false },
                },
              }}
            /> 

Screenshot_20210928_105727
Screenshot_20210928_110729

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions