HumbleSoftware / Flotr2

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

uncaught exception: The target container must be visible #314

Open chandrusuresh opened 8 years ago

chandrusuresh commented 8 years ago

I am trying to use jQuery to make a reference to an div id to plot. I am getting the: uncaught exception: The target container must be visible

http://jsfiddle.net/kzdLmrsa/

cesutherland commented 8 years ago

Here you go!

Doesn't look like jQuery was included in that page, and Flotr2 was pointing to raw github content, which doesn't serve JS. I've updated the fiddle for you! http://jsfiddle.net/649agyk5/2/

-c

On Thu, Jun 16, 2016 at 7:00 AM, Chandrasekar Sureshkumar < notifications@github.com> wrote:

I am trying to use jQuery to make a reference to an div id to plot. I am getting the: uncaught exception: The target container must be visible

http://jsfiddle.net/kzdLmrsa/

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/HumbleSoftware/Flotr2/issues/314, or mute the thread https://github.com/notifications/unsubscribe/AAVQ9hrUVzOau_fvvFP9DwRSsw7ecdpwks5qMVcJgaJpZM4I3apJ .

chandrusuresh commented 8 years ago

does it work for you? It does not display the plot for me.

cesutherland commented 8 years ago

My bad! I missed saving the proper link to the flotr2 script:

http://jsfiddle.net/649agyk5/3/

On Thu, Jun 16, 2016 at 12:41 PM, Chandrasekar Sureshkumar < notifications@github.com> wrote:

does it work for you? It does not display the plot for me.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/HumbleSoftware/Flotr2/issues/314#issuecomment-226591661, or mute the thread https://github.com/notifications/unsubscribe/AAVQ9irsq7M2czS53ziKYImXp4OtvA5Kks5qMabhgaJpZM4I3apJ .

chandrusuresh commented 8 years ago

Thx. But I would like to find out how to use jQuery calls to make it work. Specifically, looking at the last line, can you jquery the element by calling ($("#example")) instead of GetElemenyById()?

jamesfraser commented 8 years ago

@chandrusuresh The function needs a DOM element - you can get jquery to return this by using $("#example")[0] or $("#example").get(0), as per this jquery documentation

See the updated example: http://jsfiddle.net/649agyk5/5/