Search code examples
c#zedgraph

C# graphing with ZedGraph


Is it possible to select a point and simply delete it off the graph so that the image can be saved without that point?


Solution

  • You probably can do it in this way:
    Subscribe for the MouseClick event, find the nearest point and delete it.

    Here you can find an example how to subscribe for event in ZedGraph: http://zedgraph.org/wiki/index.php?title=Edit_Points_by_Dragging_the_Mouse [website down, link broken]

    You will need to use FindNearestPoint method to find clicked point. this method will return you the CurveItem and ID of the clicked point. You can delete it just by using the RemovePoint method of the CurveItem object.

    Just remember, that after every change you need to call Invalidate or Refresh method of your control to refresh the chart.