Page 1 of 1
Empty DB Fields ( null )
Posted: Fri Jun 11, 2004 9:01 am
by 8122325
Hello ,
When a Styles.ValueList.DataMember property refers to a data field which contains null values then the chart does not correctly draw the line of data . Is this problem already fixed ? How may I avoid this ?
Thanks
Jo
Posted: Tue Jun 15, 2004 7:13 am
by Chris
Hi Jo,
When a Styles.ValueList.DataMember property refers to a data field which contains null values then the chart does not correctly draw the line of data . Is this problem already fixed ? How may I avoid this ?
The following code used with TeeChart for .NET v1.1.1544.23908, the latest available, works as expected here:
Code: Select all
private DataTable dt;
private void InitializeChart() {
Random rnd = new Random();
dt = new DataTable();
dt.Columns.Add(new DataColumn("XValues", System.Type.GetType("System.Double")));
dt.Columns.Add(new DataColumn("YValues", System.Type.GetType("System.Double")));
DataRow dr;
for(int i=0; i<10; ++i) {
dr = dt.NewRow();
dr["XValues"] = i;
if(i==5)
dr["YValues"] = DBNull.Value;
else
dr["YValues"] = rnd.Next(100);
dt.Rows.Add(dr);
}
}
private void Form1_Load(object sender, System.EventArgs e) {
InitializeChart();
line1.DataSource = dt;
line1.XValues.DataMember = dt.Columns["XValues"].ToString();
line1.YValues.DataMember = dt.Columns["YValues"].ToString();
line1.CheckDataSource();
}
Could you please modify the above so that I can reproduce your problem?
Posted: Wed Jun 16, 2004 7:57 am
by 8122325
Hi Chris,
I've installed the latest version as You recommended it but it doesn't work anymore !
I found in my tests 2 cases which will bring You interest :
1. Try to use negative values in Your loop
The item with the null value will be placed anywhere but not at the right place !
2. Try to bind the X axis to a date/time field
The bottom axis is represented with the format "HH:mm:ss" .
Although X values are positive the chart will no longer display any date/time ( "00:00:00" instead )
I have another question :
Is it correct to interpret a (null) value as 0 ? Should the serie not apply an interpolation function or simply not draw the portion of line ?
Best regards
Jo
Posted: Wed Jun 16, 2004 10:44 am
by Chris
Hi Jo,
I found in my tests 2 cases which will bring You interest :
1. Try to use negative values in Your loop
The item with the null value will be placed anywhere but not at the right place !
2. Try to bind the X axis to a date/time field
The bottom axis is represented with the format "HH:mm:ss" .
Could you please modify my code-snippet and post it here so that I can reproduce the problem "as-is" ? Many thanks.
Is it correct to interpret a (null) value as 0 ? Should the serie not apply an interpolation function or simply not draw the portion of line ?
In the example I sent you, the line series simply does not draw the portion of the line.
Posted: Thu Jun 17, 2004 5:52 am
by 8122325
Hi Chris ,
I've understand whyYou can't reproduce the problem . The line You use is a Styles.Line object but the line I use is a Style.FastLine object !
If You try to use such an object You will see the problem I explained to You .
Best regards
Jo
Posted: Thu Jun 17, 2004 3:17 pm
by Chris
Hi .
I've understand whyYou can't reproduce the problem . The line You use is a Styles.Line object but the line I use is a Style.FastLine object !
If You try to use such an object You will see the problem I explained to You .
Try: