Home forums Using CanvasJS drill down on data point click Reply To: drill down on data point click

#26243

Hi Shashi

I have resolved above problem as well. Now new thing is happening. I am calling function on data point click which is as given below. the problem is in visitorsChartDrilldownHandler if I enabled alert(”) then chart is plotting but If I comment that alert chart is not plotting. I am failed understand the reason. Kindly help me out.

click: onClick,

function visitorsChartDrilldownHandler(e) {
pageViewsSplineAreaChartI = new CanvasJS.Chart(“inq”, inqDrilldownedChartOptions);
pageViewsSplineAreaChartI.options.data = LineChartData[e.dataPoint.name];
pageViewsSplineAreaChartI.options.title = { text: e.dataPoint.name}; //text: e.dataPoint.name }
console.log(e.dataPoint.name);
alert(”);
//setInterval(pageViewsSplineAreaChartI.render(),50000);
pageViewsSplineAreaChartI.render();
$(“#backButton”).toggleClass(“invisible”);
}

$(“#backButton”).click(function () {
$(this).toggleClass(“invisible”);
pageViewsSplineAreaChartI = new CanvasJS.Chart(“inq”, inqOptions);
pageViewsSplineAreaChartI.options.data = LineChartData[“inq Data”];
dataPointsCol.splice(0,dataPointsCol.length)
//alert(dataPointsCol);
pageViewsSplineAreaChartI.render();

});

function onClick(e){
//alert( e.dataSeries.type+ “, dataPoint { x:” + e.dataPoint.x + “, y: “+ e.dataPoint.y + ” }” );
colpara = e.dataPoint.x;
//alert(colpara);
showDetail(colpara);
visitorsChartDrilldownHandler(e);

}

function showDetail(colpara) {
//alert(colpara);
var s = colpara;
var coldata = {s:colpara};
//var sParam = colpara.toString();
$.ajax({
type: “POST”,
url: “ZipDashBoard.aspx/DrillDow”,
data: JSON.stringify(coldata), // passing the parameter
contentType: “application/json; charset=utf-8”,
dataType: “json”,
success: function(retValue) {
//alert(retValue.d);
newColData = eval(retValue.d);
//alert(newColData);
for (var i = 0; i < newColData.length; i++)
{
dataPointsCol.push({
label: newColData[i].x,
y: newColData[i].y
});
}

}
});

}