Representing null values

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Paul
Newbie
Newbie
Posts: 18
Joined: Fri Jan 09, 2004 5:00 am

Representing null values

Post by Paul » Mon Feb 02, 2004 10:04 am

Hi,

I'm wondering about how to represent null values. I am plotting a time series with time on the x-axis and the parameter I'm measuring on the y-axis. I'm using a line plot with the points visible e.g.

Code: Select all

myTimeSeries = New Steema.TeeChart.Styles.Line()
myTimeSeries.Pointer.Style.Visible = True
As I'm adding the points to my graph, I check to see if the parameter value is null or not (i.e. if the parameter has been measured at the particular time or not). If it is null, I wish to illustrate on the plot that the value is missing e.g. by a gap in the line plot maybe? Is this possible with my current choice of plot (i.e. line). How do I add a null point to my series? I've read (in help and FAQ) that the AddNull and AddNullXY methods are superceded by the Add method but my attempts have all generated errors, e.g.

Code: Select all

TimeSeries.Add(myDateTimeValue, System.DBNull.value, Color.Transparent)
Thanks

Paul

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Feb 02, 2004 12:25 pm

Hi Paul,

from the TeeChart for Net Tutorials :

Adding Null points to a Series
-------------------------------------
Series.Add has three overloads which allow you to add a Null point to a Series:
Adds a new null (transparent) point.
public Int32 Add()

Adds a new null point with specified text.
public Int32 Add(System.String)

Adds a new null point at a specified x value with specified text
public Int32 Add(System.Double, System.String)


The second of the above overloads will add a Null point to the Series allowing you to define a label for the point but leaving a break in the Series at that point. In the case of a Line Series, the last point before the break will not join to the first point after the break.
Example


[C#] line1.Add("Null Point"); [VB.Net] Line1.Add("Null Point")
Please look up the other two overloads in the TeeChart Help File for examples of their use.

Paul
Newbie
Newbie
Posts: 18
Joined: Fri Jan 09, 2004 5:00 am

Post by Paul » Mon Feb 02, 2004 1:08 pm

Hi Josep,

Thanks for the reply. I'm afraid I still can't get it too work as I'd like. I have been adding my points using the following

Code: Select all

TimeSeries.Add(dtDateTime, dblParameterValue, TimeSeriesColour)
where dtDateTime is a variable of type Date, dblParameterValue is a variable of type Double and TimeSeriesColour is a variable of type color. Lets assume I'm trying to add a point for each day in the period from 01/01/2004 to 05/01/2004 inclusive. The value is not null for all days bar 03/01/2004, i.e.

Date
01/01/2004 10
02/01/2004 11
03/01/2004 NULL
04/01/2004 11
05/01/2004 12

I want to represent the missing value on the 03/01/2004 as a gap in my line plot. I've tried what you suggested but the x-axis scale disappears. Could you provide an example?

Thanks again,

Paul

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Mon Feb 02, 2004 5:51 pm

Hi, Paul.

In your case when null point x position is not simply point index, you should use normal x,y,Color.Transparent overloaded version to add null point at specific x,y coordinate. Something like this:

Code: Select all

line1.Add(DateTime.Parse("01/01/2004"),10);
line1.Add(DateTime.Parse("02/01/2004"),11);
// Add null point at x= 3/1/2004, y = 0
line1.Add(DateTime.Parse("03/01/2004"),0,Color.Transparent);
line1.Add(DateTime.Parse("04/01/2004"),11);
line1.Add(DateTime.Parse("05/01/2004"),12);
The only small problem is the null value gap is not drawn correctly. There is no line from 2/1 to 3/1 (correct), but there is still a line connecting 3/1 and 4/1. This has been fixed in the latest (v7 pre release) VCL version and hopefully the fix will be applicable to NET version as well.
Marjan Slatinek,
http://www.steema.com

Paul
Newbie
Newbie
Posts: 18
Joined: Fri Jan 09, 2004 5:00 am

Post by Paul » Tue Feb 03, 2004 12:40 pm

Hi Marjan,

Thanks for the reply. When do you think V7 will become available and am I eligible for a free update if I'm not a Pro Support subscriber.

Paul

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Feb 03, 2004 3:06 pm

Hi Paul,
Thanks for the reply. When do you think V7 will become available and am I eligible for a free update if I'm not a Pro Support subscriber.
I think the TeeChart Pro v7 will be ready in a few weeks (three or four), and as it's a major release you should pay for the upgrade (v6 to v7).

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Wed Feb 18, 2004 9:50 pm

Hello Paul,

Please note that TeeChart for .NET Build 1.1.1499.42325 includes the fix for the null point plot problem. It is available as a no-charge upgrade for customers.

Accessible via:

http://www.steema.com/downloads/client_access.html

The following code sample works correctly with the latest version.

Code: Select all

line1.Add(DateTime.Parse("01/01/2004"),10); 
line1.Add(DateTime.Parse("02/01/2004"),11); 
// Add null point at x= 3/1/2004, y = 0 
line1.Add(DateTime.Parse("03/01/2004"),0,Color.Transparent); 
line1.Add(DateTime.Parse("04/01/2004"),11); 
line1.Add(DateTime.Parse("05/01/2004"),12);
Regards,
Marc Meumann
Steema Support

Post Reply