如何重设Zed图形以重绘 [英] How to reset zed graph for redraw
本文介绍了如何重设Zed图形以重绘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,先生,
我今天是Satardekar.
我会根据组合框选择在单击按钮时使用 zed图形显示饼图.
第一次单击时效果很好.
现在,当我再次单击时,我想重置先前的图形并显示新图形.
或当我点击重置"按钮时,必须清除图形.
请给我解决方法.
我的代码是这样的,
Hi sir ,
I am uday Satardekar.
I am showing pie chart using zed graph on button click depending upon combobox selection.
First time when i clicked it works nice.
Now when again i clicked,i want to reset previous graph.and display new graph.
or when i clik reset button it have to clear the graph.
please give me solution.
my code is like this,
GraphPane myPane = zgc.GraphPane;
myPane.Border.IsVisible = false;
myPane.Legend.IsVisible = false;
myPane.Title.FontSpec.Size = 24;
myPane.Legend.FontSpec.Size = 50;
Color color = CreateRandomColor();
for (int i = 0; i < getCategoryTable().Rows.Count; i++)
{
// myPane.Title.Text = Convert.ToString(getCategoryTable().Rows[i]["categoryname"]);
myPane.AddPieSlice(getCategoryCount(Convert.ToInt32(getCategoryTable().Rows[i]["ID"])), color, 0.01, Convert.ToString(getCategoryTable().Rows[i]["categoryname"]));
}
推荐答案
现在我得到了这样的解决方案.
Now I got solution like this.
zedGraphControl2.GraphPane.CurveList.Clear();
zedGraphControl2.AxisChange();
zedGraphControl2.Invalidate();
zedGraphControl2.GraphPane.Title.Text = "";
它对我有用
its working for me
这篇关于如何重设Zed图形以重绘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文