Setting snapToDataPoint to true automatically snaps crosshair to nearest data point, otherwise follows mouse co-ordinates.
Default: falsevar chart = new CanvasJS.Chart("container",
{
.
.
axisY:{
crosshair:{
enabled: true,
snapToDataPoint: true,
.
.
}
},
.
.
});
chart.render();