I have a ZedGraphControl with a few curves in it, and I want to add vertical lines at some fixed x positions. Of course, the lines should be inside the area of the actual graph.
I tried to follow
LineObj line = new LineObj(Color.Black, xPos, myPane.YAxis.Scale.Min, xPos, myPane.YAxis.Scale.Max);
line.Line.Style = System.Drawing.Drawing2D.DashStyle.Dash;
line.Line.Width = 1f;
myPane.GraphObjList.Add(line);
and this works great until the user enlarges the graph, the vertical lines will stretch out of the actual area of the graph (see. Fig. link below, also note that it is not broken on the graph, odd).
http://imageshack.us/photo/my-images/196/zedgraphzoom.png/
Is there a way to solve this problem (if there was a way to get myPane.Xaxis.Scale.Min and Max of the current zoom, and then update the graph in ZoomEvent?), Or are there any better classes / methods to use for this purpose, except LineObj?