benkeen / d3pie

A configurable pie chart lib and generator built on d3.js
MIT License
371 stars 203 forks source link

Creating mutiple pie #117

Closed jaforom closed 7 years ago

jaforom commented 7 years ago

Hi,

When I create multiple pies, the browser console show these errors:

d3pie.min.js:8 Uncaught TypeError: Cannot read property 'x' of undefined(…)(anonymous function) @ d3pie.min.js:8o @ d3.min.js:1(anonymous function) @ d3.min.js:3Y @ d3.min.js:1Co.each @ d3.min.js:3Co.attr @ d3.min.js:3positionLabelGroups @ d3pie.min.js:8(anonymous function) @ d3pie.min.js:9(anonymous function) @ d3pie.min.js:8
d3pie.min.js:8 Uncaught TypeError: Cannot read property 'value' of undefined(…)

The created pies doesn't show their labels and percentages. These multiple pies are created using a loop (for).

If only one pie is created, the console doesn't show any error messages and the pie is created right (its labels and percentages are showed).

Any idea?

Versions:

Regards

jaforom commented 7 years ago

Sorry, it's my fault... The reason of this behaviour was the cssPrefix, that it was the same for all pies. By using a unique cssPrefix for each pie, the problem was resolved.

Thanks