manu_dilip_shah
manu_dilip_shah

Reputation: 900

How to remove element from ChartArea

I am creating a chart control

chart1.ChartAreas.Add("area");
chart1.series.add("time");

//loop    
//get values of a and b from excel sheet    
chart1.Series["time"].Points.AddXY(a, b);
//endloop

I have to plot a graph between A and B.Now when second time the application is started it shows that ChartControl already contain a member called area.

So i want to remove area from chart control and time from series.How to remove it?

Upvotes: 0

Views: 5466

Answers (1)

V4Vendetta
V4Vendetta

Reputation: 38210

I assume you mean to say when you refresh the ChartArea and Series are being added again.

Please check if they are added within a if (! IsPostBack)

else you would need to add something like

Chart1.ChartAreas.Clear();
Chart1.Series.Clear();

before adding the ChartArea, Series.

if not please add additional details to your question.

Upvotes: 1

Related Questions