Gold, Andrew, your solution is golden.

On Wednesday, May 7, 2014 at 8:37:27 AM UTC-6, Andrew Gallant wrote:
>
> You can add this to the end of your chart drawing function (assumes 
> "chart" is your chart object, "data" is your DataTable/DataView, and 
> "options" is your chart options, this should work whether you are using 
> plain chart objects, ChartWrappers, or a Dashboard).
>
> Plain javascript example:
>
> function resizeCharts () {
>     // redraw charts, dashboards, etc here
>     chart.draw(data, options);
> }
> if (window.addEventListener) {
>     window.addEventListener('resize', resizeCharts);
> }
> else if (window.attachEvent) {
>     window.attachEvent('onresize', resizeCharts);
> }
> else {
>     window.onresize = resizeCharts;
> }
>
> jQuery example:
>
> function resizeCharts () {
>     // redraw charts, dashboards, etc here
>     chart.draw(data, options);
> }
> $(window).resize(resizeCharts);
>
> On Wednesday, May 7, 2014 5:33:09 AM UTC-4, Mickey Kay wrote:
>>
>> Hi Daniel,
>>
>> This is exactly what I need as well. Can you point me to more info on how 
>> to redraw the chart on window resize/orientation-change? I need to create 
>> some responsive charts, and if fluid percentage widths won't work, I'll 
>> need to figure out this redraw solution. Thanks!
>>
>> On Monday, March 5, 2012 7:27:40 AM UTC-8, Julien wrote:
>>>
>>> Hi, 
>>>
>>> Is there any way I can make a responsive line chart, i.e., a line 
>>> chart whose width wouldn't be hardcoded but would depend e.g. on the 
>>> CSS container's width? 
>>>
>>> Thanks! 
>>>
>>> Julien
>>
>>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to