Hello Visualization API group,
I am hitting a very odd error using a couple of very basic core google
visualization charts.
Using the area, bar, column or line charts, whenever I reload the page
by a form submission (get or post) I get a error message 'cannot read
property "document" of null' instead of my expected chart. If I hit
reload, or go to the page directly from a url, the chart renders
fine.
My charting code is very simple:
google.load('visualization', '1', {'packages':['corechart']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable(
(my datatable json),
0.6
);
var chart = new
google.visualization.LineChart(document.getElementById('chart_div1'));
var params = {(some parameters)};
chart.draw(data, params);
I encounter the error right after chart.draw. Even if I delete the
contents of the parameter array, I still encounter the issue.
This error is not occurring in firefox 3.6.8, and is occurring
consistently on google chrome 6.0.472.53, both running on Ubuntu. I
have heard of others encountering the issue on safari, but have not
confirmed the issue there.
I have a consistent reproducer for chrome here:
https://pub.needlebase.com/actions/visualizer/V2Visualizer.do?domain=Disasters&thread=Disaster.Incident+Start+Month^&typeId=8946670875749132661&render=Chart&chartSort=&selectedChart=LineChart&colIds=_Type&startPage=1&actionType=&targetParam=&messageJsp=&query=&queryDescription=&folder=&advQuery=&showCheckboxes=false&lastQueryName=&ownerOnly=
(note that in about a week, we may deploy a workaround that simply
refreshes the page if we encounter an error).
What makes this issue particularly odd, is that it does not always
occur. We have a number of different 'domains of data'. In the
Disasters domain that I linked above, the issue consistently occurs
for anything that we try to chart in that domain. The issue does not
occur for other domains, even others served by the same machine.
Several other domains consistently exhibit this behavior with chrome,
while most domains do not.
Has anybody encountered this issue before? Searching for the error
text did not turn up much of use. It appears that we are hitting a js
exception deep within the charting code, and falling through to a
catch block.
Thank you for any assistance.
Josh Ain