experience-experiments / react-easy-chart

[DEPRECATED] - Easy to use React Charting library
http://experience-experiments.github.io/react-easy-chart
BSD 3-Clause "New" or "Revised" License
142 stars 55 forks source link

Multiple pie-charts on page is not working #143

Closed SamirMokiem closed 4 years ago

SamirMokiem commented 5 years ago

When i try to show multiple pie-charts. Only the first one is showing up. I think the problem is that the charts have the same classNames image

Here you can see the first one, but not the second one. image

Is this a bug. Or do i need to set a prop for the pie-chart? <PieChart size={100} data={[ {value: 100, color: '#34AE92'}, {value: 100, color: '#E1E1E0'}, ]} /> <PieChart size={100} data={[ {value: 100, color: '#34AE92'}, {value: 100, color: '#E1E1E0'}, ]} />

csamarchi commented 5 years ago

i have this same problem have you figured it out? i'm trying to work it out now

SamirMokiem commented 5 years ago

Not a good solution. But i skipped this repository and i am now using react-chartjs-2. The code i used is this: import {Pie} from 'react-chartjs-2'

const data = { datasets: [{ data: [this.props.profileComplete, 100 - this.props.profileComplete], backgroundColor: [ '#34AE92', '#E1E1E0' ], }] };

<Pie data={data} height={100} options={{ maintainAspectRatio: false, tooltips: {enabled: false}, hover: {mode: null}, legend: { display: false, } }} />

csamarchi commented 5 years ago

nice i skipped this repository too and found one that works-- react minimal pie chart

thanks for the quick response

pptthh commented 5 years ago

Hi! As I see if you try to display the same data two or more times the only the first gets rendered. My workaround is that i modify the data a little bit.

SamirMokiem commented 4 years ago

Closing. Repo is deprecated