Re: Bubble chart dimension bug

26 views
Skip to first unread message

asgallant

unread,
Jul 5, 2012, 11:09:07 AM7/5/12
to google-visua...@googlegroups.com
You need to unhide the chart div prior to drawing the chart, then hide it again when the chart is finished drawing:

var bubbleChart new google.visualization.BubbleChart($('bubble_div')[0]);
​$('bubble_div').show();
google.visualization.events.addListener(bubbleChart'ready'function ({
    $('bubble_div').hide();
});
bubbleChart.draw(data{/*options*/}); 

On Thursday, July 5, 2012 5:23:22 AM UTC-4, Raizer wrote:
Hi all,
first of all sorry for my English but i'm Italian.

Now... i have several chart displayed on my page (all html5+javascript+jquery), some are hidden (display: none) and other not. If i hide motion chart or geochart everything work flawless, but if i use this tag on bubblechart the graph "forget" his dimension, resulting in a 400x200 stamp.
This is the code i use regularly  with other chart.

  <div style="width: 100%; clear: left; display: none;" id="internet-frame">
        <div style="width: 50%; float: left ; text-align: center; ">
            <div id="internet-bubble" style="width: 650px; height: 360px;margin: 0 auto "></div>
        </div>
    </div>

this is what i use with bubblechart

   <div style="height: 900px;display: none" id="bubble-frame">
           <div id="chart_div"  style="width: 900px; height: 400px;"></div>
    </div>

if i use this snippet of code instead (without hiding it)
           <div id="chart_div"  style="width: 900px; height: 400px;"></div>
everything works fine...


Help, please... i'm out of solution. I even tried using an iframe but it produce the same bug.

Reply all
Reply to author
Forward
0 new messages