API debugging tool?

158 views
Skip to first unread message

Tommy Mckinnon

unread,
Jan 8, 2012, 5:02:21 PM1/8/12
to Google Visualization API
If my website requests a chart via the ajax visualization API but
there is some error in the request, is there any debugging tool where
I can see what error the API encountered?

MC Get Vizzy

unread,
Jan 9, 2012, 7:03:53 AM1/9/12
to google-visua...@googlegroups.com
You mean, there's an error when you try to send() the google.visualization.Query()?


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


Tommy Mckinnon

unread,
Jan 10, 2012, 12:48:11 AM1/10/12
to Google Visualization API
The ajax api loads an iframe with an empty <head> and <body> where
there would normally be a geo map. I have no idea why due to lack of
debugging. This only happens with firefox.

On Jan 9, 4:03 am, MC Get Vizzy <getvi...@google.com> wrote:
> You mean, there's an error when you try to send() the
> google.visualization.Query()?
>

Jinji

unread,
Jan 10, 2012, 9:02:50 AM1/10/12
to google-visua...@googlegroups.com
Works for me (http://code.google.com/apis/ajax/playground/?type=visualization#geo_map).
Can you provide a sample HTML that reproduces the issue?

asgallant

unread,
Jan 10, 2012, 10:42:51 AM1/10/12
to google-visua...@googlegroups.com
Can you post a link to your page or a code snippet that replicates the problem?

NA

unread,
Jan 10, 2012, 1:46:42 PM1/10/12
to Google Visualization API
Sorry if it's obvious, but did you try F12 to see what the debugger
tells you? I believe the debugger also has a "Net" tab which lets you
see all the network requests being made. You should be able to verify
that all the queries your app is making are successful from there;
that would let you pin down the problem to something on the client-
side vs server-side.

Tommy Mckinnon

unread,
Jan 11, 2012, 1:18:03 AM1/11/12
to Google Visualization API
Here is my page: http://analyticalpath.com/app/343200656/ . To load
the map you click the "worldwide map" button on the left, then click
"app popularity map".
You can see the code in the console when clicking that button. But
here is the code for reference:
<script type='text/javascript'>
$(document).ready(function(){

var map_data = new google.visualization.DataTable();
map_data.addColumn('string', 'Country');
map_data.addColumn('number', 'Rank');
map_data.addRows([["Finland",29],["New Zealand",34],["Canada",38],
["Ireland",41],["USA",49],["Australia",51],["Mexico",52],["Nicaragua",
54],["Norway",54],["Switzerland",54],["Netherlands",59],["UK",59],
["Germany",64],["Panama",65],["Denmark",67],["Belgium",67],
["Guatemala",70],["Austria",70],["Sweden",79],["Malta",84],["Slovakia",
84],["Latvia",85],["Paraguay",88],["El Salvador",89],["Spain",91],
["Hungary",93],["Cyprus",99],["France",103],["Greece",116],["Portugal",
116],["Poland",119],["Colombia",120],["Peru",121],["Lithuania",122],
["Italy",125],["Czech Republic",128],["Chile",134],["Ecuador",134],
["Slovenia",139],["Honduras",140],["Luxembourg",145],["Estonia",161],
["Bulgaria",163],["Argentina",164],["Venezuela",166],["Costa Rica",
176],["Romania",178],["Japan",189],["Dominican Republic",222],
["Bolivia",324],["Brazil",422]]);
var map_options = {colorAxis: {colors: ['#fee82f', '#000000']},
datalessRegionColor: '#000'};
var map_chart = new
google.visualization.GeoChart(document.getElementById('map_div'));
map_chart.draw(map_data, map_options);

});

</script>

It works in every browser except Firefox.

Tommy Mckinnon

unread,
Jan 11, 2012, 1:20:37 AM1/11/12
to Google Visualization API
Yes, I used firebug for firefox. It showed no warnings or errors. The
javascript appears to be working perfectly. I believe the problem is
in the transaction between the browser and the charts API server.

Tommy Mckinnon

unread,
Jan 11, 2012, 1:21:40 AM1/11/12
to Google Visualization API
I will take a look at the "Net" tab and try to figure out what is
happening. Thanks for the info!

On Jan 10, 10:46 am, NA <nabeel.a...@gmail.com> wrote:

asgallant

unread,
Jan 11, 2012, 9:41:51 AM1/11/12
to google-visua...@googlegroups.com
I'm not quite sure what is going on in FF, but it looks like either a) FF is not throwing the 'ready' event when you load the content dynamically, or b) FF does not execute <script> elements added dynamically to the page.  You're running afoul of the same problem I've seen crop up again and again with people trying to dynamically load JS code to draw their charts, only you've had more success than others (as your charts actually draw in some browsers).
Reply all
Reply to author
Forward
0 new messages