Hey I just thought I'd let everyone know how I solved my issue of
Firefox not displaying the Google visualization API Graphs. I knew
that if I used the google.setOnLoadCallback function that the graph
would load display correctly. As I was using AJAX this function did
not help. I looked for alternatives in Google's AJAX API and found an
alternative to the setOnLoadCallBack that is supposed to be used when
dealing with AJAX requests. My particular implementation was
google.load('visualization', '1', {'callback':drawAreaChart}); The
callback portion is the important part of the query that lists a
function that you want called on callback. Using this instead of the
google.setOnLoadCallBack is what resolved my issue. See this page for
more information, http://code.google.com/apis/ajax/documentation/#Dynamic
.

-Pat


On Jun 4, 4:14 pm, Genghisu <[email protected]> wrote:
> I have a page with several tabs that when clicked fires off a
> JQuery.ajax call which inserts a pair of charts generated by the
> Visualization API into a block element on the page.  The code that is
> being inserted into the page looks something like the following (chart
> data is generated dynamically in practice):
>
> <script type="text/javascript">
>     function drawCharts() {
>         var peer_data = new google.visualization.DataTable();
>         var expert_data = new google.visualization.DataTable();
>
>         peer_data.addColumn('string', 'Choice');
>         expert_data.addColumn('string', 'Choice');
>
>         peer_data.addColumn('number', 'Percentage');
>         expert_data.addColumn('number', 'Percentage');
>
>         peer_data.addRows([['Yes', 30]]);
>
>         peer_data.addRows([['No', 70]]);
>
>         expert_data.addRows([['Yes', 38]]);
>
>         expert_data.addRows([['No', 62]]);
>
>         var peer_chart = new
> google.visualization.PieChart(document.getElementById('peer_chart_div'));
>
>         peer_chart.draw(peer_data, {width: 400, height: 240, is3D:
> true, title: "Peers"});
>
>     }
>
>     drawCharts();
> </script>
>
> <div id='peer_chart_div' class='chart'>
> </div>
> <div id='expert_chart_div' class='chart'>
> </div>
>
> This works fine on Opera and Chrome, but on Firefox no charts are
> being displayed.  When I look at the DOM, all I see are two empty
> iframes:
>
> <iframe id="GChart_Frame_1" width="400" scrolling="no" height="240"
> frameborder="0" name="GChart_Frame_1" marginheight="0"
> marginwidth="0">
> <html>
> <head>
> <title/>
> </head>
> <body/>
> </html>
> </iframe>
>
> Looked around these boards but could not find anything, so any help
> would be appreciated.  Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to