<script type="text/javascript">
var strarr = "[{name:'sfdsdfLi', y:9}, {name:'Kiwsdfi', y:3}, {name:'Mixesdfdnuts', y:1} ,{name:'Oranges', y:6}, {name:'Grapes', y:1}]";
$(function () {
$("#search_data").on('click', function () {
var fromdate = $('[ID*=fromdate]').val();
var todate = $('[ID*=todate]').val();
var value = $('[ID*=valuedrop] option:selected')[0].value;
var obj = {};
var value = {};
obj.fromdate = fromdate;
obj.todate = todate;
obj.value = value;
value = value;
Getdata(obj, reg);
return false;
});
});
function Getdata(obj, reg) {
$.ajax({
type: "POST",
url: "WebForm1.aspx/GetVo",
data: JSON.stringify(obj),
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
success: function (result) {
var myData = result.d;
console.log(result.d);
if (myData !== null && Object.keys(myData).length !== 0) {
strarr = result.d;
var myarr = eval(strarr);
// Drewchart(myarr);
$("#tabledata").show();
$("#container").show();
$("#Button6").show();
$("#<%=Label5.ClientID%>").hide();
$("#<%=Label4.ClientID%>").hide();
$("#<%=CrystalReportViewer1.ClientID%>").hide();
}
else {
$("#tabledata").hide();
$("#container").hide();
$("#cont").hide();
$("#<%=Label5.ClientID%>").show();
$("#<%=Label5.ClientID%>").text("DATA NOT FOUND");
$("#<%=Label4.ClientID%>").hide();
return;
}
},
error: function (error) {
alert('no data');
}
});
}
</script>