使用 ZedGraph 进行 C# 绘图
是否可以选择一个点并将其从图表中删除,以便在没有该点的情况下保存图像?
Is it possible to select a point and simply delete it off the graph so that the image can be saved without that point?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能可以这样做:
订阅
MouseClick
事件,找到最近的点并将其删除。您可以在此处找到如何在
ZedGraph
中订阅事件的示例: http://zedgraph.org/wiki/index.php?title=Edit_Points_by_Dragging_the_Mouse [网站已关闭,链接已损坏]您将需要使用
FindNearestPoint
方法查找点击点。此方法将返回单击点的CurveItem
和ID
。您只需使用RemovePoint
方法即可删除它CurveItem
对象的。请记住,每次更改后,您都需要调用 控件刷新图表。
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 theCurveItem
andID
of the clicked point. You can delete it just by using theRemovePoint
method of theCurveItem
object.Just remember, that after every change you need to call
Invalidate
orRefresh
method of your control to refresh the chart.