Hi,
My CanvasJs chart loads and works perfectly. i am trying to pass date parameter to the query so that the chart loads value based on the date range i select. Below are my code ,
` var fromdate = $(“#frmdate”).val();
//alert(fromdate);
var todate = $(“#todate”).val();
//alert(todate);
var orderqty = $.getJSON(“samplemasterfile.php?method=getorderqty&fromdate=”+fromdate+”&todate=”+todate, function (result) {
var chart1 = new CanvasJS.Chart(“OrderChart”,
{
title:{
text: “Order Quantity”
},
legend:{
verticalAlign: “bottom”,
horizontalAlign: “center”,
fontSize: 15,
fontFamily: “Times New Roman”,
fontWeight: “normal”
},
theme: “theme2″,
toolTip:{
content: function(e){
var content;
content = e.entries[0].dataSeries.legendText + ” “+e.entries[0].dataPoints.y + “” ;
return content;
}
},
data: [
{
type: “pie”,
indexLabelFontFamily: “Times New Roman”,
indexLabelFontSize: 15,
//indexLabel: “{label} {y}%”,
indexLabel: “{y}”,
startAngle: -80,
showInLegend: true,
toolTipContent:”{legendText} {y}”,
dataPoints: result
}
]
});
chart1.render();
});’
here i am trying to pass fromdate and todate to the query. please throw some light.
Many thanks