This much looks fine. I'm actually not sure about the join and group
operations, and how many columns result.
But you didn't include your table.draw() call, so I can see which data
object you are referencing.
In your ventes function, you should store the result of the computation in
a variable, and do console.log('result', result), so you can see that you
are getting the right values.
dan
On Fri, Mar 15, 2013 at 11:27 AM, Tangred <[email protected]> wrote:
> here it is :
>
> data and magasinsTable are datatables directly load from 2 diffetent Json
> file.
>
> var joinTables= new google.visualization.data.join(data,
> magasinsTable, 'left', [[2,0]], [1,5,7,8],[1]);
> var groupedValue = google.visualization.data.group(joinTables,
> [1,0],[{'column': 4, 'aggregation': google.visualization.data.sum, 'type':
> 'number'},{'column': 3, 'aggregation': google.visualization.data.sum,
> 'type': 'number'}]);
> var viewJoinTables = new google.visualization.DataView(groupedValue);
> var table = new
> google.visualization.Table(document.getElementById('test_dataview'));
> //viewJoinTables.setRows(viewJoinTables.getFilteredRows([{column: 1,
> maxValue: 907}]));
> viewJoinTables.setColumns([0,1,2,3, {type:'number', label:'total',
> calc:ventes} ]);
>
>
> function ventes (joinTables, row) {
> console.log(joinTables);
> console.log('hello');
> return joinTables.getValue(row,2) *joinTables.getValue(row,3);
>
>
> I'm wondering if it's the size of data. I have more than 44 000 lines
>
> Le vendredi 15 mars 2013 15:52:39 UTC+1, Daniel LaLiberte a écrit :
>>
>> I think you will need to give more of your example. From what you
>> provide, which looks OK, we can't tell where groupedValue comes from, or
>> when you draw your table, what data you are giving it. I would guess you
>> should be giving the table your viewJoinTables.
>>
>> dan
>>
>>
>> On Fri, Mar 15, 2013 at 10:46 AM, Tangred <[email protected]> wrote:
>>
>>>
>>> var viewJoinTables = new google.visualization.DataView(**groupedValue);
>>> var table = new google.visualization.Table(**
>>> document.getElementById('test_**dataview'));
>>> viewJoinTables.setColumns([0,**1,2,3, {type:'number', label:'Total',
>>> calc: ventes} ]);
>>> function ventes (groupedValue, row) {
>>> return 2;
>>>
>>> }
>>> my column is still empty ...
>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Daniel LaLiberte<https://plus.google.com/100631381223468223275?prsrc=2>
>>>> - 978-394-1058
>>>> [email protected] 562D 5CC, Cambridge MA
>>>> [email protected] 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 google-visualization-api+**[email protected].
>>> To post to this group, send email to google-visua...@**googlegroups.com.
>>>
>>> Visit this group at http://groups.google.com/**
>>> group/google-visualization-**api?hl=en<http://groups.google.com/group/google-visualization-api?hl=en>
>>> .
>>> For more options, visit
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
>>
>>
>> --
>> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
>> - 978-394-1058
>> [email protected] 562D 5CC, Cambridge MA
>> [email protected] 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.
>
>
>
--
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> -
978-394-1058
[email protected] <[email protected]> 562D 5CC, Cambridge MA
[email protected] <[email protected]> 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.