calc [*function*] - A function that will be called for each row in the 
column to calculate a value for that cell. The function signature is func(*
dataTable*, *row*), where *dataTable* is the sourceDataTable, and *row* is 
the index of the source data row. The function should return a single value 
of the type specified by type.

viewJoinTables.setColumns([0,1,2,3, {type:'number', label:'Total', calc: 
ventes(joinTables, row)} ]); 
 function ventes (joinTables, row) {
return joinTables.getValue(row,2) *joinTables.getValue(row,3);
  
}

i got an error row is not defined, well but i dont understand where i 
should define row. There is something in the pattern i dont understand ...

Le vendredi 15 mars 2013 14:57:06 UTC+1, Daniel LaLiberte a écrit :
>
> It looks like you are trying to use the 'calc' option, but calling it 
> 'func' instead.  Try 'calc'.  
>
> Your copied text has at least one syntax error, as well: '{)'
>
> dan
>
>
> On Fri, Mar 15, 2013 at 9:33 AM, Tangred <[email protected]<javascript:>
> > wrote:
>
>>
>> viewJoinTables.setColumns([0,**1,2,3,* {type:'number', label:'Total', 
>> func: function(groupedValue, rowNum){) return 
>> groupedValue.getValue(rowNum,2) 
>> * groupedValue.getValue(rowNum,3);}*} ]);
>>
>> (without the *; *in the middle* :)*
>> Le vendredi 15 mars 2013 14:30:23 UTC+1, Tangred a écrit :
>>
>>> Hello,
>>>
>>> sorry if i overlooked, but i did'nt find the answer.
>>>
>>> I have a datattable with quantity and unit price for each line, i would 
>>> to get the total per line in a data view.
>>>
>>> product  unit_price quantity *TOTAL*
>>> AAA          30           2          60
>>> BBB          40           2          80
>>> CCC         120          3          360
>>>
>>> i find the option to "group by" sum by column but not in a row. 
>>>
>>> i tried :
>>> viewJoinTables.setColumns([0,**1,2,3,* {type:'number', label:'Total', 
>>> func: function(groupedValue, rowNum){); return 
>>> groupedValue.getValue(rowNum,2) 
>>> * groupedValue.getValue(rowNum,3);}*} ]);
>>>
>>> but all cells in my last column are empty ...
>>>
>>> Can you help me ?
>>>
>>> Regards
>>>
>>  -- 
>> 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]<javascript:>
>> .
>> To post to this group, send email to 
>> [email protected]<javascript:>
>> .
>> Visit this group at 
>> http://groups.google.com/group/google-visualization-api?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>
>
> -- 
> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> 
>  - 978-394-1058
> [email protected] <javascript:>   562D 5CC, Cambridge MA
> [email protected] <javascript:> 9 Juniper Ridge Road, Acton MA
>  

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to