Hi All ,
We have a taks to pass the json array value in the google chart . when we were trying to bind the database , how to assign the json array to that google chart. If anyone knows this guide us with sample .
Sample code :
$(function () {
$.ajax({
type: "POST",
url: "InteractiveDashboard.aspx/Web_GetTotalSaleslist",
data: '{}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
failure: function (response)
{
//alert(response.d);
alert("Error..1");
},
error: function (response)
{
alert("Error..2");
alert(response);
}
});
});
function OnSuccess(response) {
// var jsonResult = JSON.stringify(response.d)
// alert(jsonResult);
var jsonResult = JSON.parse(response.d);
var jsonCount = jsonResult.length;
for (var n = 0; n < jsonCount; n++)
{
var _Month = jsonResult[n].Month;
var _TotalsalesAmt = jsonResult[n].TotalsalesAmt;
}
sessionStorage.setItem("JsonResult", JSON.stringify(jsonResult));
// loop the jsonresult Here
drawBasic();
};
Thanks in advance ,
K.Karthik.K