>
> On Thursday, 22 September 2011 22:57:39 UTC+10, Steffan Hoeke wrote:
> I was aware that I can use calculated columns, but that's not what i want 
> ;)
> I'm specifically looking for a way to add a totals *Row *(as a footer in 
> the table), and since a googler indicated in an older topic that it was on 
> their todo list hoped it would have been implemented by now :)

Thanks for your response.


This is an old thread but I have recently updated all my tables with what I 
have found to be the best solution for a "Totals" row for  Google Chart 
Table.

Why is this solution the best I've used?
1. It is a footer row so does not get sorted when the column header is 
clicked
2. It is not a separate table so doesn't create problems with aligning 
column widths

After creating and drawing my table, I add this following 2 lines of code:

    var mytable_foot = jQuery('<tfoot>').appendTo("#mytable table");

    mytable_foot.append('<tr>'+
          '<th class="google-visualization-table-td">Total</th>'+
          '<th class="google-visualization-table-type-number 
google-visualization-table-td"><?php echo $count;?></th>'+
          '<th class="google-visualization-table-type-number 
google-visualization-table-td">$ <?php echo number_format($sales,2);?></th>'
+
          '<th class="google-visualization-table-type-number 
google-visualization-table-td">$ <?php echo number_format($gp,2);?></th>'+
          '<th class="google-visualization-table-type-number 
google-visualization-table-td">$ <?php echo 
number_format($svc_sales,2);?></th>'+
          '<th class="google-visualization-table-type-number 
google-visualization-table-td">$ <?php echo 
number_format($svc_gp,2);?></th>'+
    '</tr>'); 

 

-- 
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 https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/d89eb577-c54e-49bf-8827-e7ad5ec6ee36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to