search

Home  >  Q&A  >  body text

Integration with built-in charts and Google Charts using PrimeReact

I'm using primereact and react-google-charts. However, they all require me to call the components Charts. When I write a chart, an error occurs. What solution should I follow?

(https://i.stack.imgur.com/4qGie.png)(https://i.stack.imgur.com/5dpNr.png)

I tried to call the component chart, but VSCode reported an error. Then I tried calling it Gantt but I got the above error.

P粉458913655P粉458913655444 days ago639

reply all(1)I'll reply

  • P粉563446579

    P粉5634465792023-09-07 10:27:13

    You can use import alias

    import {Chart as GoogleChart} from 'react-google-charts';
    import {Chart as PrimeChart} from 'primereact';

    Now you can use GoogleChart and PrimeChart anywhere

    <GoogleChart />
    <PrimeChart />

    reply
    0
  • Cancelreply