The simplest way to clone a DataTable is to use it's clone method as documented in the API<http://code.google.com/apis/visualization/documentation/reference.html#DataTable> . An alternative way is to use the json constructor from the original table's json which you can get by using the toJSON() method of DataTable (also documented there).
If the table is big, you might consider using different views on the same table in order to save memory, depends on the operations that each of your specific visualizations requires. To learn more on how to create a DataView of a given DataTable and what are the possible views, take a look at the documentation<http://code.google.com/apis/visualization/documentation/reference.html#DataView> . Best, Viz Kid On Thu, Nov 26, 2009 at 4:22 PM, Rune V. Sjoen <[email protected]> wrote: > Is there a simpler way to make a copy of a DataTable rather than > manually looping through and adding rows/columns ? > > What I want is to make a single query of a rather large datatable, and > use this table to do multiple visualizations. > However each visualization needs different changes done to the data. > > -- > > You received this message because you are subscribed to the Google Groups > "Google Visualization API" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-visualization-api%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-visualization-api?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
