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>