HumbleSoftware / Flotr2

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

Attach a finished drawing event to the Flotr #315

Closed amirmog closed 8 years ago

amirmog commented 8 years ago

I have been searching everywhere to just understand how to add a callback or an event handler which gets triggered when the Flotr graph is actually finished with its drawing.

My graph draws okay with small or mid size data but when I use a larger set of data, the graph takes much longer to draw. While it's trying to draw, the graph container is blank so I would like to show a loading spinner while it's trying to draw and hide this spinner when the graph is actually finished with its drawing.

So my question is how to know when the graph has really completed its drawing?

Could someone please point me to the right direction or provide with some code sample. Any help would be much much appreciated.

Thank you,

amirmog commented 8 years ago

Any help...? Thanks

cesutherland commented 8 years ago

Hey Amir,

Drawing happens synchronously! So you can execute your "after" code right after calling the Flotr draw method.

-c

On Wed, Aug 3, 2016 at 4:08 PM, Amir Moghadam notifications@github.com wrote:

Any help...? Thanks

— 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/315#issuecomment-237402883, or mute the thread https://github.com/notifications/unsubscribe-auth/AAVQ9qatEa4feCFS3fN9pClfuUECyOOcks5qcR-AgaJpZM4JWhmA .

amirmog commented 8 years ago

Hey Carl,

Okay awesome, I just realized that as I sandwiched the drawing code in between 'befoer' nad 'after' code. Thanks for your help, Cheers.

cesutherland commented 8 years ago

Cheers!