Zoom on null values

TeeChart for ActiveX, COM and ASP
Post Reply
Petar
Newbie
Newbie
Posts: 40
Joined: Tue Oct 06, 2009 12:00 am

Zoom on null values

Post by Petar » Mon Dec 06, 2010 10:43 am

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 6214 times
Before Zoom:
beforeZoom.png
beforeZoom.png (33.02 KiB) Viewed 6215 times

After zoom on 18/11/10 -> 28/11/10 area
afterZoom.png
afterZoom.png (28.69 KiB) Viewed 6224 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

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

Re: Zoom on null values

Post by Narcís » Tue Dec 07, 2010 12:08 pm

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 6202 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.
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

Petar
Newbie
Newbie
Posts: 40
Joined: Tue Oct 06, 2009 12:00 am

Re: Zoom on null values

Post by Petar » Tue Dec 07, 2010 2:07 pm

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

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

Re: Zoom on null values

Post by Narcís » Tue Dec 07, 2010 2:50 pm

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.
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

Petar
Newbie
Newbie
Posts: 40
Joined: Tue Oct 06, 2009 12:00 am

Re: Zoom on null values

Post by Petar » Tue Dec 07, 2010 3:05 pm

Thank you for the solution, I think that we'll rather use the last non-null value.

Thanks,

Petar

Post Reply