I am not able to see graph below is following code i have written.
Please let me know what is wrong in the code
var xmlDocGetSalesYearForMonth = null;
function GetSalesYearForMonth(sy) {
 var xmlhttpGetYear = new XMLHttpRequest();
 if (xmlhttpGetYear != null) {
    xmlhttpGetYear.onreadystatechange = function() {

        var state = xmlhttpGetYear.readyState;
        if (state == 1 || state == 2 || state == 3) {
            Load();
        }
        if (state == 4) {
            UnLoad();
            if (xmlhttpGetYear.status == 200) {
                xmlDocGetSalesYearForMonth =
xmlhttpGetYear.responseXML.documentElement;
                if (xmlDocGetSalesYearForMonth.childNodes.length > 0)
{
                    google.setOnLoadCallback(function() {
                       var data = new
google.visualization.DataTable(), TotalSale = 0;
                       data.addColumn('string', 'Month');
                       data.addColumn('number', 'Sales');
                       var serverData = [];
                       for (var i = 0; i <
xmlDocGetSalesYearForMonth.childNodes.length; i++) {
                           TotalSale +=
Number(xmlDocGetSalesYearForMonth.childNodes[i].getAttributes("Amount"));

serverData.push([xmlDocGetSalesYearForMonth.childNodes[i].getAttributes("Id"),
xmlDocGetSalesYearForMonth.childNodes[i].getAttributes("Amount")]);
                       }
                       data.addRows(serverData);
                       var chart = new
google.visualization.ColumnChart(document.getElementById('report'));
                       chart.draw(data, { width: 400, height: 240 });
                    });
                }
                else
                    ShowMessage(false, " Zero sales for year " + sy);
            }
            else
                ErrorMessage(xmlhttpGetYear);
        }
    }
    xmlhttpGetYear.open("GET", "../Ajax/AjaxCallManager.aspx?
info=26&sy=" + sy, 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