Clearing data in a series, including Null indexes

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Aaron Peronto
Newbie
Newbie
Posts: 38
Joined: Thu Feb 01, 2007 12:00 am

Clearing data in a series, including Null indexes

Post by Aaron Peronto » Thu Jun 07, 2007 7:51 pm

I have a chart with a series added to it.
One of the indexes in this series is set to Null using the Series.SetNull(index) call.

I then wish to clear the series of all data and re-populate my series.
I do NOT wish to clear my color settings for this series or other line properties.
I call the Series.XValues.Clear() and Series.YValues.Clear() methods.

When I re-populate my series with data, I am NOT calling the .SetNull() method on any of the indexes in the series and yet I am still seeing holes in the graph at the location of the index that was originally set to be a Null point.

Does the Clear() method on XValues and YValues not clear the null settings for the indexes in those series?

How can I clear the list of indexes that are treated as Nulls?

What I am trying to avoid is destroying the Series completely and having to rebuild that Series from the ground up. I wish to keep the properties that have been assigned to this series but simply clear out all of the data.

We have not yet upgraded to v3 of the .NET controls so we are still on TeeChart v2 for .NET.

Thanks for your help once again.

Aaron

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

Post by Narcís » Fri Jun 08, 2007 7:55 am

Hi Aaron,

This is because what SetNull(ValueIndex) method does is setting the point color to transparent, for example:

Code: Select all

			line1.SetNull(ValueIndex);
is equivalent to:

Code: Select all

			line1.Colors[ValueIndex]=Color.Transparent;
So when you are clearing your series data, if you want to reset null points you should assign a color to them, for example:

Code: Select all

			for (int i = 0; i < line1.Count; i++)
			{
				if (line1.Colors[i] == Color.Transparent)
					line1.Colors[i] = line1.Color;				
			}
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

Aaron Peronto
Newbie
Newbie
Posts: 38
Joined: Thu Feb 01, 2007 12:00 am

Post by Aaron Peronto » Fri Jun 08, 2007 1:00 pm

Thanks for the quick response.

That actually answers another question that I was going to ask this morning.
I was going to check to see how I could undo the null settings on points within my data series without affecting the actual data.
That shows me how to do both.

So what else besides the data and the Color settings for that data will the Series.Clear() method reset? I did not use that initially because the description of it talks about removing the data, the text and Color for the series. I wasn't sure which Color that meant but now I understand a little better.

Thanks again.

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

Post by Narcís » Fri Jun 08, 2007 1:18 pm

Hi Aaron,

Clear method will basically clear x values, y values, labels, color and marks of a series.
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