Page 1 of 1

Zoom on null values

Posted: Mon Dec 06, 2010 10:43 am
by 15054354
Hi,

I have a problem while zooming on area with null Values. Hereafter you can see all my charted values

allvalues.png
allvalues.png (6.5 KiB) Viewed 6218 times
Before Zoom:
beforeZoom.png
beforeZoom.png (33.02 KiB) Viewed 6219 times

After zoom on 18/11/10 -> 28/11/10 area
afterZoom.png
afterZoom.png (28.69 KiB) Viewed 6228 times

At the beginning (before zoom) the slope of the curve between 09/11/10: 46.11 and 22/11/10: 51.668 seems normal.
Just after zoom the slope changes significantly (between 18/11/10 -> 22/11/10) , because it links the value 0 of 18/11/10 with value 51.668 at 22/11/10.
I would like to have the same slope as the one between 09/11/10 and 22/11/10, because all values between these two dates are Null values ( added with ADDNULLXY function), and so 18/11/10 value of 0 should not be taken into account.
How should I proceed?

Thanks

Petar

Re: Zoom on null values

Posted: Tue Dec 07, 2010 12:08 pm
by narcis
Hi Petar,

I see your bottom axis is zoomed but not your left axis. Do you only have horizontal zoom enabled? Code snippet below doesn't produce such a chart for me here. If I zoom around 18th November I don't get the first segment painted:
ZoomNulls.jpg
ZoomNulls.jpg (56.14 KiB) Viewed 6206 times
Is this what you expected? Which TeeChart version are you using? Could you please modify code snippet below so that we can reproduce the problem here?

Code: Select all

Private Sub Form_Load()
    TChart1.Aspect.View3D = False
    TChart1.Axis.Bottom.Labels.DateTimeFormat = "dd/mm/yy"
    TChart1.AddSeries scLine
    TChart1.Series(0).asLine.TreatNulls = tnSkip
    TChart1.Series(0).XValues.DateTime = True
    TChart1.Series(0).AddXY CDate("8 / 11 / 2010"), 46.494, "", clTeeColor
    TChart1.Series(0).AddXY CDate("9 / 11 / 2010"), 46.11, "", clTeeColor
    TChart1.Series(0).AddNullXY CDate("10 / 11 / 2010"), 0, ""
    TChart1.Series(0).AddNullXY CDate("11 / 11 / 2010"), 0, ""
    TChart1.Series(0).AddNullXY CDate("12 / 11 / 2010"), 0, ""
    TChart1.Series(0).AddNullXY CDate("15 / 11 / 2010"), 0, ""
    TChart1.Series(0).AddNullXY CDate("16 / 11 / 2010"), 0, ""
    TChart1.Series(0).AddNullXY CDate("17 / 11 / 2010"), 0, ""
    TChart1.Series(0).AddNullXY CDate("18 / 11 / 2010"), 0, ""
    TChart1.Series(0).AddNullXY CDate("19 / 11 / 2010"), 0, ""
    TChart1.Series(0).AddXY CDate("22 / 11 / 2010"), 51.668, "", clTeeColor
    TChart1.Series(0).AddXY CDate("23 / 11 / 2010"), 50.363, "", clTeeColor
    TChart1.Series(0).AddXY CDate("24 / 11 / 2010"), 51.2, "", clTeeColor
    TChart1.Series(0).AddXY CDate("25 / 11 / 2010"), 50.25, "", clTeeColor
    TChart1.Series(0).AddNullXY CDate("26 / 11 / 2010"), 0, ""
    TChart1.Series(0).AddXY CDate("29 / 11 / 2010"), 52.15, "", clTeeColor
End Sub
Thanks in advance.

Re: Zoom on null values

Posted: Tue Dec 07, 2010 2:07 pm
by 15054354
Hi Narcis,


I forgot to precise that I'm using fastlines. I'm using version 8 of TeeChart. You can check this code:

Code: Select all

  
  Private Sub Form_Load()
        TChart1.Aspect.View3D = False
        TChart1.Axis.Bottom.Labels.DateTimeFormat = "dd/mm/yy"
        TChart1.AddSeries (scFastLine)
        TChart1.Series(0).asFastLine.TreatNulls = tnSkip
        TChart1.Series(0).XValues.DateTime = True
        TChart1.Series(0).AddXY CDate("8 / 11 / 2010"), 46.494, "", clTeeColor
        TChart1.Series(0).AddXY CDate("9 / 11 / 2010"), 46.11, "", clTeeColor
        TChart1.Series(0).AddNullXY CDate("10 / 11 / 2010"), 0, ""
        TChart1.Series(0).AddNullXY CDate("11 / 11 / 2010"), 0, ""
        TChart1.Series(0).AddNullXY CDate("12 / 11 / 2010"), 0, ""
        TChart1.Series(0).AddNullXY CDate("15 / 11 / 2010"), 0, ""
        TChart1.Series(0).AddNullXY CDate("16 / 11 / 2010"), 0, ""
        TChart1.Series(0).AddNullXY CDate("17 / 11 / 2010"), 0, ""
        TChart1.Series(0).AddNullXY CDate("18 / 11 / 2010"), 0, ""
        TChart1.Series(0).AddNullXY CDate("19 / 11 / 2010"), 0, ""
        TChart1.Series(0).AddXY CDate("22 / 11 / 2010"), 51.668, "", clTeeColor
        TChart1.Series(0).AddXY CDate("23 / 11 / 2010"), 50.363, "", clTeeColor
        TChart1.Series(0).AddXY CDate("24 / 11 / 2010"), 51.2, "", clTeeColor
        TChart1.Series(0).AddXY CDate("25 / 11 / 2010"), 50.25, "", clTeeColor
        TChart1.Series(0).AddNullXY CDate("26 / 11 / 2010"), 0, ""
        TChart1.Series(0).AddXY CDate("29 / 11 / 2010"), 52.15, "", clTeeColor
    End Sub
Thanks,

Petar

Re: Zoom on null values

Posted: Tue Dec 07, 2010 2:50 pm
by narcis
Hi Petar,

The only solution I can think of is adding more intermediate points as a smoothing function would:

Code: Select all

    TChart1.AddSeries scFastLine
    TChart1.Series(1).SetFunction tfSmoothing
    TChart1.Series(1).DataSource = TChart1.Series(0)
However, smoothing function ignores null values so you should add intermediate points to your data.

Re: Zoom on null values

Posted: Tue Dec 07, 2010 3:05 pm
by 15054354
Thank you for the solution, I think that we'll rather use the last non-null value.

Thanks,

Petar