Page 1 of 1

Axis Automatic scale incorrectly interprets NULL as 0 (zero)

Posted: Thu Jul 13, 2006 11:39 pm
by 9637330
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.

Posted: Fri Jul 14, 2006 8:07 am
by narcis
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);

Posted: Fri Jul 14, 2006 10:28 am
by 9639271
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.

Posted: Fri Jul 14, 2006 10:34 am
by narcis
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.

Posted: Fri Jul 14, 2006 10:35 am
by 9639271
Ok !

Thanks.

Cybertof.

Posted: Fri Jul 14, 2006 2:11 pm
by 9637330
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())?

Posted: Mon Jul 17, 2006 10:33 am
by narcis
Hi mweaver,

Yes, you can use:

Code: Select all

tChart1.Axis.Left.AutomaticMinimum = false; 
tChart1.Axis.Left.Minimum = myvalue;