Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
web method is not working for my chart . annual sales function not call any thing add in web config page explan details

What I have tried:

<script>

// VISUALIZATION API AND THE PIE CHART PACKAGE.
google.load("visualization", "1", { packages: ["corechart"] });

google.setOnLoadCallback(createPIE);

function createPIE() {

var options = {
title: 'Monthly sale of Books',
colors: ['#888', 'orange'],
is3D: true
};
alert("ffff");
$.ajax({
url: "webmethod.aspx/Annual_Sales",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
success: function(data) {

var arrValues = [['Month', 'Sales Figure']]; // DEFINE AN ARRAY.
var iCnt = 0;

$.each(data.d, function() {

// POPULATE ARRAY WITH THE EXTRACTED DATA.
arrValues.push([data.d[iCnt].Month, data.d[iCnt].SalesFigure]);
iCnt += 1;

});

// CREATE A DataTable AND ADD THE ARRAY (WITH DATA) IN IT.
var figures = google.visualization.arrayToDataTable(arrValues)

// THE TYPE OF CHART (PieChart IN THIS EXAMPLE).
var chart = new google.visualization.PieChart(document.getElementById('b_sale'));

chart.draw(figures, options); // DRAW GRAPH WITH THE DATA AND OPTIONS.

},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert('Got an Error');
}
});
}
</script>
Posted
Comments
Suvendu Shekhar Giri 31-Jul-16 6:48am    
Not Clear. What is the issue here?
Nethaji chennai 1-Aug-16 0:50am    
Annual_Sales method not call i set break point

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900