[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2094
  • Last Modified:

How to remove all series in a Chart

Hello EE,

I am creating series inside a chart in VB.Net with a DataSource.
when user click on another button I want the chart to refresh with another Datasource. But I need to delete all series first because otherwise I am having error saying series already exists. name must be unique.

I am not sure how to remove programmatically all the series with a for Next

any ideas?
0
PhilippeRenaud
Asked:
PhilippeRenaud
  • 2
  • 2
1 Solution
 
HainKurtSr. System AnalystCommented:
maybe you should create a new series and assign it to chart.series...
0
 
PhilippeRenaudAuthor Commented:
but I do not wnat to see the previous series... ??
0
 
HainKurtSr. System AnalystCommented:
in a loop maybe you can do this

while (Chart1.Series.Count > 0) Chart1.Series.RemoveAt(0);
0
 
PhilippeRenaudAuthor Commented:
yup.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now