为jqplot创建的图标新增onclick事件。代码如下:
/* CLICK CODE START*/ $('#chart2').bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) { getAccount(pointIndex); } ); /* CLICK CODE END*/
还会用到:如何获取y轴参数名?从pointIndex入手,参考如下代码:
function getAccount(pointIndex){ var account=$("#hd_account").val(); var ticksLst=new Array(); ticksLst = account.split(','); //alert(ticksLst[pointIndex]); }
hd_account.Value += Ls[i].sChargeAccount + ",";
C#后台参数自己构造,记住参数位置与pointIndex一一对应即可。