esbullington / react-d3

Modular React charts made with d3.js
https://reactiva.github.io/react-d3-website/
MIT License
1.75k stars 179 forks source link

Can't create charts with this package #347

Open ankit6373 opened 5 years ago

ankit6373 commented 5 years ago

I installed react-d3 package in my react project but It is giving this error

download

Here is my component:

`

    import React, { Component } from 'react';
    import { PieChart } from 'react-d3';

    class CusBarChart extends Component {

         state  = {
              pieData : [
                 {label: 'A', value: 5},
                 {label: 'B', value: 6},
                 {label: 'F', value: 7}
             ]
          }

         render() {
                return (
                     <div className="content">
                            <PieChart
                                data={this.state.pieData}
                                width={400}
                                height={400}
                                radius={100}
                                innerRadius={20}
                                sectorBorderColor="white"
                                title="Pie Chart"
                            />
                       </div>
                );
          }
      }

     export default CusBarChart;

`