Updating this to allow pivoting an arbitrary number of row values into 
columns has been on my to-do list for a while.  I refactored the base code 
to enable this: http://jsfiddle.net/asgallant/HkjDe/

On Wednesday, December 11, 2013 5:59:34 PM UTC-5, Sudhir Kesharwani wrote:
>
> Hello Champs,
>
> I am in a situation with Google Table / Charts. and would like to convert 
> it onto Pivot Table (http://jsfiddle.net/asgallant/HkjDe/ this link 
> contains the solution that worked like charm for me earlier *thanks asg*)
>
> My Table has following structure,  I could have any number of projects in 
> future.
>
>   Year Project Resources  2013 A 25  2012 B 2  2014 A 5  2012 C 6  2015 A 
> 56  2014 D 5  2013 A 6  2013 N 5  … … … 
> I would like to transform this table as a pivot table where each project 
> becomes a column of the table.
>
>    Year A B C D … N  2012 5 0 2 0 2 0  2013 0 55 0 5 6 6  2014 6 44 44 55 
> 0 0  2015 66 0 0 0 55 55 
> The issue here is that i am not aware of the number of columns so i will 
> have to generate columns based on index and script in an array.
>
> var myarr = [0, {
>         type: 'number',
>         label: VARIABLE,
>         calc: function (dt, row) { return (dt.getValue(row, 1) == VARIABLE) 
> ? dt.getValue(row, 2) : null;
>         }}]
>
> I was thinking of creating an array with script blocks. How would i be 
> able to store some number and script blocks into the same array. 
>

-- 
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.

Reply via email to