3

I try to show X,Y and the name of the curve which was drawn on the graph when cursor comes on it. I used

 zedGraphControl1.IsShowPointValues = true;

but it isn't enough. I need also curve name. When the cursor is on the curve in the graph information should be shown like that:

12/27/2010 12:09 AM, 49.94, ACTIVE_MW

Is it possible?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
derya
  • 65
  • 3
  • 5

1 Answers1

9

It is possible. You can add an event handler to the PointValueEvent event that gets fired when you mouse-over a point.

Something like:

this.zedGraphControl1.PointValueEvent += new ZedGraph.ZedGraphControl.PointValueHandler(this.zedGraphControl1_PointValueEvent);

private string zedGraphControl1_PointValueEvent(ZedGraph.ZedGraphControl sender, ZedGraph.GraphPane pane, ZedGraph.CurveItem curve, int iPt)
{
   return curve.Label.Text + " - " + curve.Points[iPt].ToString();
}
PeskyGnat
  • 2,454
  • 19
  • 22