Page 1 of 1

How to correctly display NaN values (missing data points)

Posted: Fri Oct 20, 2006 7:42 am
by 9341477
Hi!

Using TeeChart 7.07 Professional, BDS2006/Delphi for Win32

I have a group of X-Y values which is not contiguous, i.e. there happen to be some data points where only X-value is provided and corresponding Y-value is NaN (missing data). I use AddXY method of point series to add the data points.

The problem is that at runtime TeeChart is having a difficult time to determine the minimum and maximum values of the point series probably due to presence of NaNs. So I decide to determine these missing data points beforehand and use AddNullXY method to add them to the series. Now the chart is displaying them correctly but since the Y-value is required by AddNullXY method, I have to supply one for each missing data point even if those data points don't have any. This raises another problem - I let my chart Y-axis to determine its scaling automatically, but in order to do it correctly, I must determine the correct Y-values beforehand to make sure they do not exceed the Y-range of existing data points. This is very annoying. Is there a way to add a null data points only by specifying its X-Value so that they do not affect the automatic axis scaling determination?

I would very appreciate your help. Thanks!

Posted: Fri Oct 20, 2006 9:28 am
by narcis
Hi Ivo,

I can think of 2 options here:

1. Use AddNull method which only allows a label argument without X and Y values.
2. AddX method which only needs an X value and no Y value.

Is any of those options acceptable for your case?

Posted: Fri Oct 20, 2006 11:13 am
by 9341477
Hi NarcĂ­s,

I actually realized that the missing data points don't really need to be visible and that I don't need have them labeled either. So, the best solution would be not to add those missing points (when IsNaN() returns True) to the series in the first place. :oops:

I apologize for a bit harsh tone of my original post, as I'm approaching a project deadline and getting a bit nervous (as always). Your support has always been very good. Got a sleep for couple of hours and everything seems to be better right now.

Thanks!