codesuki / react-d3-components

D3 Components for React
http://codesuki.github.io/react-d3-components/example.html
MIT License
1.63k stars 206 forks source link

PieChart not rendering #164

Open Kunal1985 opened 5 years ago

Kunal1985 commented 5 years ago

Hi, I am using the PieChart example but it is not rendering. Below the error in Browser console logs. Error: attribute y1: Expected length, "NaN". Error: attribute y2: Expected length, "NaN". Error: attribute transform: Expected number, "rotate(NaN)". Error: attribute transform: Expected number, "translate(NaN,NaN)". Error: attribute transform: Expected number, "translate(NaN,NaN)".

Kindly suggest if i am missing something here.

Thanks, Kunal

asifsha commented 5 years ago

var sort = null; var dataPie = { label: 'somethingA', values: [{ x: 'SomethingA', y: 10 }, { x: 'SomethingB', y: 4 }, { x: 'SomethingC', y: 3 }] };

<PieChart data={dataPie} width={600} height={400} margin={{ top: 10, bottom: 10, left: 100, right: 100 }} sort={sort} />

image

Worked for me, can you please try again?