benkeen / d3pie

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

Calling openSegment does not open segment #93

Open cht opened 9 years ago

cht commented 9 years ago

I am trying to pre-open a segment on a pie immediately after its creation. Calling openSegment(index) explicitly does not seem to work (in fact it seems to leave the pie permanently unclickable).

To reproduce: Copy code example from http://d3pie.org/website/examples/openCloseSegment.html and add pie.openSegment(2); after var pie=new d3pie({...});

jbailey2954 commented 8 years ago

It seems like calling methods on the d3pie object before it's finished loading causes problems. Putting the code inside the onload event handler in the config object seems to work though.