Note that there are some explanatory texts on larger screens.

plurals
  1. POGrand Total in Google visualization dashboard table
    text
    copied!<p>I have a simple Google visualization dashboard sample with one categorypicker control and a table. My code is given below.</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="content-type" content="text/html; charset=utf-8"/&gt; &lt;script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; google.load('visualization', '1.1', {packages: ['controls']}); &lt;/script&gt; &lt;script type="text/javascript"&gt; function drawVisualization() { // Prepare the data. var data = google.visualization.arrayToDataTable([ ['Metric', 'Value'], ['CPU' , 12], ['Memory', 20], ['Disk', 7], ['Network', 54] ]); // Define a category picker for the 'Metric' column. var categoryPicker = new google.visualization.ControlWrapper({ 'controlType': 'CategoryFilter', 'containerId': 'control', 'options': { 'filterColumnLabel': 'Metric', 'ui': { 'allowTyping': false, 'allowMultiple': true, 'selectedValuesLayout': 'belowStacked' } }, }); // Define a table. var table = new google.visualization.ChartWrapper({ 'chartType': 'Table', 'containerId': 'chart', 'options': { 'width': 400, 'height': 180 } }); // Create the dashboard. var dashboard = new google.visualization.Dashboard(document.getElementById('dashboard')). // Configure the category picker to affect the table bind(categoryPicker, table). // Draw the dashboard draw(data); } google.setOnLoadCallback(drawVisualization); &lt;/script&gt; &lt;/head&gt; &lt;body style="font-family: Arial;border: 0 none;"&gt; &lt;div id="dashboard"&gt; &lt;table&gt; &lt;tr style='vertical-align: top'&gt; &lt;td style='width: 300px; font-size: 0.9em;'&gt; &lt;div id="control"&gt;&lt;/div&gt; &lt;/td&gt; &lt;td style='width: 600px'&gt; &lt;div style="float: left;" id="chart"&gt;&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I am stuck with a problem that I want the grand total of the values at the end. How can I add one more row at the end of table so that it shows the Grand total of all values in second column. i.e., initially it should show the total of all four rows and when filter is applied it should show the total of filtered row values.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload