I have a general question about how to debug server side problems when
generating graphs with the google visualization API..  My server code
is django code that returns a datatable like this:

    return
HttpResponse(data_table.ToResponse(columns_order=columns_order))

My client code draws an annotated timeline with this table, and looks
like this:

  <script type="text/javascript">
      google.load('visualization', '1', {'packages':
['annotatedtimeline']});
      google.setOnLoadCallback(drawChart);

      function drawChart() {
        var query = new google.visualization.Query('/taskmanager/
vis_datasource/');
        query.send(handleQueryResponse);
      }

      function handleQueryResponse(response) {
        if (response.isError()) {
          alert('Error in query: ' + response.getMessage() + ' ' +
response.getDetailedMessage());
          return;
        }
        var data = response.getDataTable();
        var chart = new
google.visualization.AnnotatedTimeLine(document.getElementById('graph_div'));
        chart.draw(data, {title: 'Open Tasks'});
      }
</script>

If my django code that serves up the data table has an error, I find
that error doesn't get printed anywhere.  For example, even if I make
some minor syntax error, I don't get it output anywhere.  I don't
think this is an issue with the google visulation API.  I think it's
just a general problem with having the client make a request of the
server.   But could anyone give me some pointers on how they deal with
this?  During the process of generating my tables I've made all sorts
of dumb errors, and it's really painful to debug since I have to
constantly step through my server code in pdb in order to see the
error.

Thanks!

Margie


-- 
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