Google Table width and height issue

44 views
Skip to first unread message

TheInnovator

unread,
Mar 21, 2014, 3:23:38 PM3/21/14
to google-visua...@googlegroups.com
How do I increase the height and witdth of a google chart table?  No matter what I do, it does not change.

var tblOption = {
showRowNumber: true,
                        Height:500px, <<----Does not work
                        Width: 500px  <<----Does not work
};
<!-- Step 4 - Instantiate the Chart class -->
      var chart = new google.visualization.PieChart(document.getElementById('chart_div'));    
   var table = new google.visualization.Table(document.getElementById('vizTbl')); 
 
<!-- Step 6 - Call chart.draw() function, passing in 'data' and 'options' -->
        chart.draw(data, options);  
table.draw(dataAn, tblOption);


<table>
<tr><td><div id="chart_div" style="width: 700px; height: 110px;"></div></td><td>&nbsp;</td><td><div id="vizTbl" style="width: 700px; height: 110px;"></div></td></tr>
</table>

Here's what an image of what it currently looks like:


asgallant

unread,
Mar 21, 2014, 3:49:13 PM3/21/14
to google-visua...@googlegroups.com
You can set the dimensions of the table two ways: either in the "height" and "width" options, or via CSS on the container div. Specifying them in options looks like this:

var tblOption = {
    showRowNumber: true,
    height: 500, // note: lowercase "h", no "px"
    width: 500 // note: lowercase "w", no "px"
};


Your container div already has dimensions specified:


<div id="vizTbl" style="width: 700px; height: 110px;"></div>

The Table will draw with the smaller value in each dimension, when both the style and options are specified.  In this example, the Table would have a height of 110px (since the 110 in the style is smaller than the 500 in the options), and a width of 500px (since the 500 in the options is smaller than the 700 in the style).

Isaac Sogunro

unread,
Mar 21, 2014, 4:52:23 PM3/21/14
to google-visua...@googlegroups.com
That worked! Thanks!


--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/hVLn1Rzc1uc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.



--
-Isaac-

http://twitter.com/#!/feedy0urmind
You are today where your thoughts have brought you; you will be tomorrow where your thoughts take you.
- James Allen
Reply all
Reply to author
Forward
0 new messages