ZedGraph 删除饼图切片?

发布于 2024-08-05 02:04:38 字数 268 浏览 3 评论 0原文

我正在尝试使用 ZedGraphControl 创建饼图。我可以使用该方法添加饼图切片

zedGraphControl.GraphPane.AddPieSlice (30, Color.Red, Color.White, 45f, .0, "Data");

似乎都没有任何

RemovePieSlice

,但所有方法 或任何删除对象。我是否缺少一些简单的东西,或者这个库不允许删除切片?

I am trying to use the ZedGraphControl to create a pie chart. I am able to add pie slices by using the

zedGraphControl.GraphPane.AddPieSlice (30, Color.Red, Color.White, 45f, .0, "Data");

Method, but there does not seem to be any

RemovePieSlice

Or any remove object at all methods. Am I missing something simple, or does this library not allow for the removal of slices?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

贵在坚持 2024-08-12 02:04:38

AddPieSlice 返回一个 PieItem 对象; PieItem 类继承自 CurveItem。这意味着您可以通过 CurveList 属性(它是 CurveItem 对象的集合)删除 PieItem

要仅删除一个 PieItem 对象:

Dim zgc As ZedGraph.ZedGraphControl = Me.ZedGraphControl1

Dim zgPane As ZedGraph.GraphPane = zgc.GraphPane

Dim zgPieItem As ZedGraph.PieItem = zgPane.CurveList("PieItemLabel")
zgPane.CurveList.Remove(zgPieItem)

要删除所有 PieItem 对象:

Dim zgc As ZedGraph.ZedGraphControl = Me.ZedGraphControl1

Dim zgPane As ZedGraph.GraphPane = zgc.GraphPane

zgPane.CurveList.Clear()

AddPieSlice returns a PieItem object; the PieItem class inherits from CurveItem. This means you can remove the PieItem via the CurveList property (which is a collection of CurveItem objects).

To remove just one PieItem object:

Dim zgc As ZedGraph.ZedGraphControl = Me.ZedGraphControl1

Dim zgPane As ZedGraph.GraphPane = zgc.GraphPane

Dim zgPieItem As ZedGraph.PieItem = zgPane.CurveList("PieItemLabel")
zgPane.CurveList.Remove(zgPieItem)

To remove all PieItem objects:

Dim zgc As ZedGraph.ZedGraphControl = Me.ZedGraphControl1

Dim zgPane As ZedGraph.GraphPane = zgc.GraphPane

zgPane.CurveList.Clear()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文