I suspect that the difference will depend entirely on the setup of the charts and maybe the data driving them. You could create two test cases and profile the performance of each using something like Firebug<http://getfirebug.com/javascript> .
On Wednesday, June 26, 2013 4:04:32 PM UTC-4, Benin Yesu wrote: > > Thanks for the reply. > Is recreating new instance every time more costly? how do we compare the > performance between having reference and using new? e.g. (1:10)? any idea > in general? > > Thanks, > Jesu Benin. > On Wednesday, June 26, 2013 3:53:42 PM UTC-4, asgallant wrote: > >> If you want to save state information while a chart is not displayed, >> then it is most convenient to save the chart objects in a data structure >> (like an array) rather than create new ones each time; but it is generally >> more memory intensive than creating and destroying chart objects on the >> fly. There is no single answer to the "should I" question. In general, I >> would suggest pursuing whichever path fits all of your needs and is easiest >> to code. If that causes performance issues for users, then tweak until it >> works right. >> >> On Wednesday, June 26, 2013 3:31:08 PM UTC-4, Benin Yesu wrote: >>> >>> Hi, >>> >>> I am developing a webpage consist of ~25 google charts, not all 25 >>> charts will be displayed together, but based on user selection (without >>> postback) through menu, e.g. 5 charts for each menu. Now should I create a >>> new instance of the chart everytime? or can I have all the grapghs in an >>> Array and refer them back when required? >>> >>> Thanks, >>> Jesu Benin. >>> >> -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/groups/opt_out.
