I need to use the cross hair on multi-series chart, and the chart number is a variable .
the code is follow:
<? for ($i=0;$i<count($selItem);$i++) { ?>
<script type=”text/javascript”>
$(function () {
var chart = new CanvasJS.Chart(“chartContainer<? echo $i ?>”, {
//width: 100%,
zoomEnabled: true,
animationEnabled: true,
//exportEnabled: true,
title: {
text: “<? echo $selMsgName[$i] ?>”
},
toolTip:{
shared: true
},
axisX:{
crosshair : {
enabled: true,
color: “orange”,
labelFontColor: “#F8F8F8”}
},
axisY:{
margin: 30,
interval: 1,
labelFormatter: function (e) {
return customLabel<? echo $i ?>(e.value);
},
crosshair : {
enabled: true,
color: “orange”,
labelFontColor: “#F8F8F8”},
},
data: [
{
type: “stepLine”,
connectNullData: true,
markerSize: 5,
dataPoints: [<? echo $data[$i] ?>]
}
]
});
chart.render();
});
</script>
<? } ?>
how can i do?