Series.Clear() Problem

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Casper JH Erasmus
Newbie
Newbie
Posts: 17
Joined: Wed Oct 13, 2004 4:00 am
Location: South Africa

Series.Clear() Problem

Post by Casper JH Erasmus » Tue Aug 29, 2006 9:14 am

I need to plot a Point series during runtime that depends on what the user selects. The idea is that only one series is displayed at a time. Therefor, e.g. user selects series A, which is plotted, then the user selects Series B which is then plotted, while series A is removed. I've used Clear(), but it doesn't remove Series A at all.

Regards,
Casper JH Erasmus

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Aug 29, 2006 9:29 am

Hi Casper JH Erasmus,

Clear method deletes series values, colors, labels, etc. To delete the series you'd better use Remove method as shown here:

Code: Select all

    private void Form1_Load(object sender, EventArgs e)
    {
      Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
      line1.FillSampleValues();

      tChart1.Header.Text = tChart1.Series.Count.ToString();
    }

    private void button1_Click(object sender, EventArgs e)
    {
      tChart1.Series.Remove(tChart1[0]);

      Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
      bar1.FillSampleValues();

      tChart1.Header.Text = tChart1.Series.Count.ToString();
    }
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply