I understand that the documentation may be a little confusing. I'll see 
whether we can update it with some better wording.
To sum up, you can pass to setView:

a) a string as coming out from DataView.toJSON() (with the caveat that 
generated columns will be lost)

chartwrapper.setView(myDataView.toJSON()) should work, as in 
http://jsfiddle.net/rYRD4/1/ 

b) a plain javascript object containing the same representation as the above 
string, that is something like {rows: [0, 1, 2, 3], columns: [0, 1,  2, 3]} 
. In this case you can even pass in generated columns as there is no JSON 
serialization process that will destroy them.

you _can't_ pass in a google.visualization.DataView object.

To make things a little cleaner, the explanation for the logic above is that 
google.visualization.DataView represents the composition of data (the 
DataTable you pass in its constructor) and view criteria (row/column 
reordering, sorting, generation). ChartWrapper.setView() only utilizes the 
view criteria and not the data, since a ChartWrapper might receive the data 
from elsewhere (the dataTable parameter, a remote datasource via 
dataSourceUrl parameter and so on).

Hope this makes things a little bit cleaner,
/R.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/3MIeddC8YxQJ.
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.

Reply via email to