That makes perfect sense, thanks. At one point I tried to create a DataView with:
new google.visualization.DataView(); // note the empty constructor I was trying to resolve the DataView being a composition of it's own data and view criteria. Incidentally, this errors. From here, I tried passing in the DataView object, and you now know where I ended up ;) thanks again for the help and explanation. We made the tweaks needed, and are running smoothly now. On Jun 21, 1:28 pm, Riccardo Govoni <[email protected]> wrote: > 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 > inhttp://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 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.
