The google api does not provide a mechanism for this because it has a hard
coded "px" which is appended to the width value. Inserting a % mark will
choke the javascript engine.
However, there is an easy solution. Calculate the width of the parent
element and set the chart width to that.
With jQuery for example:
var chartwidth = $('#chartparent').width();
var options = {
width: chartwidth,
...
chartArea: {width:chartwidth,left:20,top:20,height:110}
};
On Monday, March 26, 2012 at 12:03:40 AM UTC-6, shub wrote:
>
> Hello,
>
> I want to know if we can create google charts with 100% width...
> I tried to give the width as 100%, but they doesn't seem to work...Does
> anyone know how to achieve this.. ?
>
--
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/6f71b216-3aa8-4912-8aae-1eea3a9245fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.