Solved

How to remove all series in a Chart

Posted on 2011-09-16
4
1,022 Views
Last Modified: 2012-06-27
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
Comment
Question by:PhilippeRenaud
  • 2
  • 2
4 Comments
 
LVL 51

Expert Comment

by:HainKurt
Comment Utility
maybe you should create a new series and assign it to chart.series...
0
 
LVL 1

Author Comment

by:PhilippeRenaud
Comment Utility
but I do not wnat to see the previous series... ??
0
 
LVL 51

Accepted Solution

by:
HainKurt earned 500 total points
Comment Utility
in a loop maybe you can do this

while (Chart1.Series.Count > 0) Chart1.Series.RemoveAt(0);
0
 
LVL 1

Author Closing Comment

by:PhilippeRenaud
Comment Utility
yup.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now