I excited with this fiddle <http://jsfiddle.net/asgallant/HkjDe/> and I tried to create the same kind with reference to that fiddle. My modified sample is given in here <http://jsfiddle.net/DUn6B/> and i'm trying to create a view as follows.
var distinctValues = data.getDistinctValues(2);
var viewColumns = [1];
var groupColumns = [];
// build column arrays for the view and grouping
for (var i = 0; i < distinctValues.length; i++) {
viewColumns.push({
type: 'number',
label: distinctValues[i],
aggregation: google.visualization.data.count
});
groupColumns.push({
column: i+1,
type: 'number',
//label: distinctValues[i],
aggregation: google.visualization.data.sum
});
}
But my aim is to create a pivot table something like as follows.
['Column1', 'Column2', 100, 200, 300, 400],['A', 'bar', 0, 1, 1, 0],['A',
'baz', 0, 0, 1, 0],['A', 'foo', 3, 1, 0, 0],['B', 'baz', 0, 1, 0, 0],['B',
'cad', 1, 0, 1, 1],['B', 'qud', 1, 1, 1, 2]
How can I proceed?
--
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.
<<< text/html; charset=US-ASCII; name=testpiv.html: Unrecognized >>>
