Page 1 of 1

NULL values

Posted: Thu Sep 06, 2007 12:18 pm
by 9525824
Hi Support

Sometimes we have to use ADDNullXY to add null values to our charts. Looking at the chart it is correct but when it is exported or when the values are looked at on the Data tab there are "zeros" for the NULL values.

How can these values be replaced with NULL? We do not want zero's because when data is exported it is not possible to distinguish between real zeros and NULLs.

Thanks
JC

Posted: Thu Sep 06, 2007 1:02 pm
by narcis
Hi JC,

Which TeeChart version are you using? In v7 and v8 null values preserve they original values and their color is set to be transparent (clNone).

Posted: Fri Sep 07, 2007 7:15 am
by 9525824
Hi Narcís

Thansk for your reply!

We are using V7.
We pass a zero to the AddNullXY function and that is the reason for the zeros when the data must be exported.

Example:
If data is displayed on a chart per half hour (there must be a value every 30 minutes) between 00:30 and 06:00,
*data is available from 00:30 to 02:30; 04:00 to 06:00
*data missing for 03:00 and 03:30

If no AddNullXY value is inserted for the missing values a straight line will be drawn between 02:30 and 04:00 - this is not correct because there are not any values available for 03:00 and 03:30.

If AddNullXY is used for 03:00 and 03:30 and Y is 999, the chart will look correct because of a gap between 02:30 and 04:00 but if the data is exported 03:00 and 03:30 will have values of 999 but should (in our case) be NULL.

I hope the example gives you a better idea of the problem.

Regards,
JC

Posted: Fri Sep 07, 2007 8:23 am
by narcis
Hi JC,

Thanks for the information.

First of all please notice that TeeChart Pro ActiveX is a COM wrapper of TeeChart Pro VCL. This means that in VCL null values doesn't exist and thus null values can be saved. In that case you should check if point's color is clNone or you could even add a label to the point saying something like "NULL" so that points are clearly marked as null, for example:

Code: Select all

    TChart1.Series(0).AddNullXY X, Y, "NULL"
It may also help you using something like in the All Features\Welcome!\Chart Styles\Financial\Candle (OHLC)\Axis Labels no Weekends example at the features demo. You'll find the demo at TeeChart's program group.

Hope this helps!

Posted: Mon Sep 10, 2007 2:51 pm
by 9525824
Hi Narcís

The problem is not with the chart or how it is displayed.

When exporting the values is should be NULL or blank where AddNullXY is used.

Kind Regards
JC

Posted: Mon Sep 10, 2007 2:57 pm
by narcis
Hi JC,

As I told you, setting values to NULL is not possible as this type is not available. Regarding leaving them blank, you can create a non-visible dummy series where you add all values except the null ones and then only export those series.

Posted: Fri Nov 02, 2007 9:13 am
by 9525824
Hi Narcís,

Sorry for only getting back to you now.

If you create a non-visible series as you suggest the value will not be exported correctly in our case. If there should be a value every thirty minutes and one value is missing there will be no “place holder” for that value – at first glance you will not see that there is a value missing, you will have to go and check each data/time value to make sure they follow one another correctly.

I think this will be a great enhancement to TeeChart and would like you to consider changing AddNullXY function to have a NULL value.

Kind Regards
JC

Posted: Fri Nov 02, 2007 9:32 am
by narcis
Hi JC,

As I told you in my previous reply, this is not possible because NULL value is not available in VCL (notice that TeeChart Pro ActiveX is a COM wrapper of the VCL version).

The only solution I can think of is that you manually export your series data and process null values as desired.