Chartjs-React COREUI CChart problem not rendering

0👍

I assume you did a fresh install of chart.js, this will install V3 of the lib. This has some major braking changes over V2 of the lib which coreUI uses. So you will need to install V2 of chart.js and that should resolve your issue:

npm uninstall chart.js
npm install chart.js@2.9.4
yarn remove chart.js
yarn add chart.js@2.9.4

0👍

try to add this:

import ‘@coreui/chartjs/dist/css/coreui-chartjs.css’

or

import '@coreui/chartjs/dist/css/coreui-chartjs.css'
import '@coreui/coreui/dist/css/coreui.min.css'
import 'bootstrap/dist/css/bootstrap.min.css'

don’t forget to install all npm packages

npm install @coreui/chartjs
npm install @coreui/coreui
npm install bootstrap

Leave a comment