Axis Automatic scale incorrectly interprets NULL as 0 (zero)

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
mweaver
Newbie
Newbie
Posts: 11
Joined: Wed Jun 22, 2005 4:00 am

Axis Automatic scale incorrectly interprets NULL as 0 (zero)

Post by mweaver » Thu Jul 13, 2006 11:39 pm

When a line series has null values, the series correctly plots a gap in the line (instead of interpolating a zero value).

However, the automatic scale of the value axis interprets the null as zero. So, if there is a NULL value, the axis minimum value will be zero, even if if all of the non-null values are way above zero (hundreds, thousands, etc.).

Also, the series.YValues.Item(x) returns zero instead of null.

It would be helpful if the NULL values were ignored when automatically scaling the value axis.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Jul 14, 2006 8:07 am

Hi mweaver,

You can use add's method and set the color to transparent as shown here:

Code: Select all

      line1.Add(4, 3);
      line1.Add(5, 6);
      line1.Add(6,2,Color.Transparent);
      line1.Add(7, 1);
      line1.Add(8, 7);
      line1.Add(9, 6);
      line1.Add(10, 8);
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

cybertof
Newbie
Newbie
Posts: 9
Joined: Mon Nov 21, 2005 12:00 am

Post by cybertof » Fri Jul 14, 2006 10:28 am

What is the link between the Narcis' answer and the question ? :roll:

(I don't understand how changing a color to transparent changes a null value not to be take into account while automatic zooming...)

Regards,

Cybertof.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Jul 14, 2006 10:34 am

Hi Cybertof,

Using Add() or Add(XValue, YValue, Color.Transparent) methods are the way to add null values to a series and work fine for automatic axes scaling. AddNull and AddNullXY methods are deprecated.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

cybertof
Newbie
Newbie
Posts: 9
Joined: Mon Nov 21, 2005 12:00 am

Post by cybertof » Fri Jul 14, 2006 10:35 am

Ok !

Thanks.

Cybertof.

mweaver
Newbie
Newbie
Posts: 11
Joined: Wed Jun 22, 2005 4:00 am

Post by mweaver » Fri Jul 14, 2006 2:11 pm

I'm binding the series to a DataView (not adding each point using the .Add() methods).

If there is a null Y-value, then the Left axis minimum value is always equal to zero.

Can you suggest a workaround when getting data from a DataView (instead of .Add())?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Jul 17, 2006 10:33 am

Hi mweaver,

Yes, you can use:

Code: Select all

tChart1.Axis.Left.AutomaticMinimum = false; 
tChart1.Axis.Left.Minimum = myvalue;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply