asLine with NULL values from database
Posted: Thu Feb 26, 2004 11:59 am
hello,
I read data values from SQL Server 2000 database. The information is the following, for example:
timestamp current voltage potential1 potential2 .......
-----------------------------------------------------------------------------------
1.1.2004 1.2984 NULL 1.5656 12.4633
2.1.2004 1.2933 NULL 1.9467 11.9364
3.1.2004 1.3100 NULL 2.1342 10.9456
.........
19.1.2004 1.2936 6.4735 2.0463 9.4732
When I fetch the data from DB with SQL statement including WHERE voltage IS NOT NULL, the asLine graph displays normally (using AddArray method for adding the data). However, the only voltage data point having a value is shown as the first data point in the voltage series, although it should be the 19th data value.
This should be avoided by adding NULL values to the graph, but when removing the WHERE voltage IS NOT NULL clause from the SQL statement, a catastrophic failure is given. This is caused by the AddArray method.
Is there another way of adding several dataseries to a linechart having occasional NULL values and still showing the correct timestamp for each data value? Should I have a loop going through all data values and check, whether the values is null and then use the AddNull method and otherwise use AddXY method, for example.
TIA
Mike
I read data values from SQL Server 2000 database. The information is the following, for example:
timestamp current voltage potential1 potential2 .......
-----------------------------------------------------------------------------------
1.1.2004 1.2984 NULL 1.5656 12.4633
2.1.2004 1.2933 NULL 1.9467 11.9364
3.1.2004 1.3100 NULL 2.1342 10.9456
.........
19.1.2004 1.2936 6.4735 2.0463 9.4732
When I fetch the data from DB with SQL statement including WHERE voltage IS NOT NULL, the asLine graph displays normally (using AddArray method for adding the data). However, the only voltage data point having a value is shown as the first data point in the voltage series, although it should be the 19th data value.
This should be avoided by adding NULL values to the graph, but when removing the WHERE voltage IS NOT NULL clause from the SQL statement, a catastrophic failure is given. This is caused by the AddArray method.
Is there another way of adding several dataseries to a linechart having occasional NULL values and still showing the correct timestamp for each data value? Should I have a loop going through all data values and check, whether the values is null and then use the AddNull method and otherwise use AddXY method, for example.
TIA
Mike