You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-visua...@googlegroups.com
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.
asgallant
unread,
Jun 26, 2013, 3:53:42 PM6/26/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-visua...@googlegroups.com
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.
Benin Yesu
unread,
Jun 26, 2013, 4:04:32 PM6/26/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-visua...@googlegroups.com
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.
asgallant
unread,
Jun 26, 2013, 6:50:04 PM6/26/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-visua...@googlegroups.com
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.