2011年7月12日 星期二

Mouse hover point to get point value (Zedgraph)

private string MyPointValueHandler(ZedGraphControl control, GraphPane pane,
CurveItem curve, int iPt)
{
PointPair pt = curve[iPt];
  return "Horizontal coordinate:" + pt.X.ToString() + " vertical coordinate:" + pt.Y.ToString();
}

private void Form1_Load(object sender, EventArgs e)
{
zedGraphControl1.IsShowPointValues = true;
zedGraphControl1.PointValueEvent += new ZedGraphControl.PointValueHandler(MyPointValueHandler);
}

沒有留言: