Empty DB Fields ( null )

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
jo
Newbie
Newbie
Posts: 3
Joined: Fri Oct 10, 2003 4:00 am
Location: switzerland
Contact:

Empty DB Fields ( null )

Post by jo » Fri Jun 11, 2004 9:01 am

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

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Tue Jun 15, 2004 7:13 am

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?
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

jo
Newbie
Newbie
Posts: 3
Joined: Fri Oct 10, 2003 4:00 am
Location: switzerland
Contact:

Post by jo » Wed Jun 16, 2004 7:57 am

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

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Wed Jun 16, 2004 10:44 am

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.
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

jo
Newbie
Newbie
Posts: 3
Joined: Fri Oct 10, 2003 4:00 am
Location: switzerland
Contact:

Post by jo » Thu Jun 17, 2004 5:52 am

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

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Thu Jun 17, 2004 3:17 pm

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:

Code: Select all

fastLine1.IgnoreNulls = false;
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Post Reply