Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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,

C#
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"]));
                
            }
Posted
Updated 22-Aug-11 18:39pm
v3

1 solution

Now I got solution like this.

C#
zedGraphControl2.GraphPane.CurveList.Clear();
            zedGraphControl2.AxisChange();
            zedGraphControl2.Invalidate();
            zedGraphControl2.GraphPane.Title.Text = "";



its working for me
 
Share this answer
 
Comments
udusat13 24-Aug-11 0:06am    
its working for me
kvicky 5-Feb-18 9:32am    
Thanks,
its working for me also for Bar graph reload

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900