HumbleSoftware / Flotr2

Graphs and Charts for Canvas in JavaScript.
http://www.humblesoftware.com/flotr2/
MIT License
2.44k stars 526 forks source link

Unable to add Flotr2 charts on a div that is created dynamically and appended to the body #170

Closed niki4810 closed 12 years ago

niki4810 commented 12 years ago

Hi,

I have a scenario where, I have a parent div and a child div that gets appended to the parent dynamically. I wanted to render a pie chart (any flotr2 chart) in my child div and append it to the parent. But when I do I get the following error : "Uncaught The target container must be visible ". I am setting the width and height on the child but still i see this error.

I have tried first append the child to parent and then pass this child as a container parameter to the flor2() function. But I still get this error.

Here is a jsFiddle for the scenario : http://jsfiddle.net/niki4810/GJrUR/

I could not find any solutions to this error, could someone help me with this ?

Thanks

cesutherland commented 12 years ago

display: visible is invalid (but ignored by the browser). The issue was, though, the jQuery selector... pass in the HTML element directly: http://jsfiddle.net/cz37V/1/

niki4810 commented 12 years ago

This is great..Thanks a lot for the solution.