I have a chart object, with methods draw and update. See this (non-working) fiddle.
draw does a lot of things with the object’s properties, and at the end, draws a chart. At this point, I am able to define an update function, since all the data that was processed by draw is there. But then I can’t call update from outside the scope.
How do I define the update method as a completely separate method so I can call it from outside the object, but have it be able to reference data within the draw method?
Update: I’ve posted some semi-pseudo code.
like this perhaps:
usage:
Live example: http://jsfiddle.net/c9TeU/