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
Empty DB Fields ( null )
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Jo,
Could you please modify the above so that I can reproduce your problem?
The following code used with TeeChart for .NET v1.1.1544.23908, the latest available, works as expected here: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 ?
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();
}
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/
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/
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
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
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Jo,
Could you please modify my code-snippet and post it here so that I can reproduce the problem "as-is" ? Many thanks.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" .
In the example I sent you, the line series simply does not draw the portion of the line.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 ?
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/
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/
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi .
Try: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 .
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/
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/