here is my code :
function getData(){
var projects = [“SFR” , “MANAGEMENT”];
var projects_results = [];
var mehdi= [];
var obj = [];
$.each(projects , function(n) {
$.ajax({
url: “php/charger.php”,
data: “projet=”+ projects[n],
type: “POST”,
success : function (result) {
obj = [{type : “column”} , {lineThickness : 3} , {axisYType:”secondary”} , {showInLegend:true} , {name: projects[n]} , {dataPoints: $.parseJSON(result)} , {“” : “,”}] ;
displayChart(obj);
}
});
});
}
function displayChart(datapointss){
var chart = new CanvasJS.Chart(“chartContainer”,
{
zoomEnabled: false,
animationEnabled: true,
title:{
text: “PROJECTS”
},
axisY2:{
valueFormatString:”0.0 days”,
// maximum: 1.2,
// interval: .2,
interlacedColor: “#F5F5F5”,
gridColor: “#D7D7D7”,
tickColor: “#D7D7D7”
},
theme: “theme2”,
toolTip:{
shared: true
},
legend:{
verticalAlign: “bottom”,
horizontalAlign: “center”,
fontSize: 15,
fontFamily: “Lucida Sans Unicode”
},
data:
datapointss
,
legend: {
cursor:”pointer”,
itemclick : function(e) {
if (typeof(e.dataSeries.visible) === “undefined” || e.dataSeries.visible) {
e.dataSeries.visible = false;
}
else {
e.dataSeries.visible = true;
}
chart.render();
}
}
});
chart.render();
}
help me !! thank you in advance