Hi,

I was trying load api dynamically, but i got following error "a[Db] is
not a function" on my html page.

Below is the code:
(below code is in my function.)
                google.load("visualization", "1", { "callback" :
function() {
                    var xmlhttpGetYear = new XMLHttpRequest();
                    if (xmlhttpGetYear != null) {
                        xmlhttpGetYear.onreadystatechange = function()
{
                            var xmlDoc = null;
                            var state = xmlhttpGetYear.readyState;
                            if (state == 1 || state == 2 || state ==
3) {
                                Load();
                            }
                            if (state == 4) {
                                UnLoad();
                                if (xmlhttpGetYear.status == 200) {
                                    xmlDoc =
xmlhttpGetYear.responseXML.documentElement;
                                    if (xmlDoc.childNodes.length > 0)
{
                                        $("#report").html("");
                                        var nowy =
xmlDoc.attributes[0].nodeValue;
                                        var TotalSale = 0;
                                        var google_chart_data = [];
                                        var data = new
google.visualization.DataTable();
                                        data.addColumn('string',
'Year');
                                        data.addColumn('number',
'Sales');
                                        for (var i = 0; i <
xmlDoc.childNodes.length; i++) {
                                            TotalSale +=
Number(xmlDoc.childNodes[i].attributes[1].nodeValue);
 
google_chart_data.push([xmlDoc.childNodes[i].attributes[0].nodeValue,
Number(xmlDoc.childNodes[i].attributes[1].nodeValue)]);
                                        }
                                        var chart = new
google.visualization.ColumnChart(document.getElementById('report'));
                                        chart.draw(google_chart_data,
{ width: 400, height: 240, title: 'Company Performance', hAxis:
{ title: 'Year', titleTextStyle: { color: 'red'} }
                                        });
                                    }
                                    else
                                        ShowMessage(false, " Zero
sales for year " + sDate.getFullYear());
                                }
                                else
                                    ErrorMessage(xmlhttpGetYear);
                            }
                        }
                        xmlhttpGetYear.open("GET", "../Ajax/
AjaxCallManager.aspx?info=26&sy=" + sDate.getFullYear(), true);
                        xmlhttpGetYear.send(null);
                    }
                }
                });

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