Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Windows 窗体上使用 ZedGraph 来显示条形图。当用户单击按钮时,将执行以下代码。
zg1.GraphPane.AddBar("Series", null, y, Color.Red);
每次用户单击按钮时,它都会添加一个额外的栏。我正在寻找一种方法来重置或清除图表中已有的数据。
我怎样才能做到这一点????
zg1.GraphPane.CurveList.Clear(); zg1.GraphPane.GraphObjList.Clear();
如果您不刷新,请不要忘记给 zg1.Refresh() 如果永远看不到结果。
不需要清除任何东西,生成图形后需要放在代码末尾的想法是zg1.Refresh()