Problems with the downsample function

TeeChart for ActiveX, COM and ASP
jer_m
Newbie
Newbie
Posts: 20
Joined: Mon Jan 28, 2008 12:00 am

Post by jer_m » Tue Feb 17, 2009 6:07 pm

Thats great news, I will be looking forward to trying it out.

Thank you Narcís,
Jerron

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

Post by Narcís » Tue Feb 24, 2009 10:37 am

Hi Jerron,

I have just sent you an e-mail with the URL to download the new ocx and a simple example.
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

jer_m
Newbie
Newbie
Posts: 20
Joined: Mon Jan 28, 2008 12:00 am

Post by jer_m » Wed Mar 04, 2009 6:46 pm

Hi Narcís,

Thank you so much, that is exactly what we were looking for!
I really appreciate this and I’m looking forward to fully implementing this in our project.

Best regards,
Jerron

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Re: Problems with the downsample function

Post by David » Tue Nov 17, 2009 4:03 am

Hi, I still couldn't find any sample code with DisplayedPointCount after searching in the feature demo code, nor can I find any info from the help file. I am using the latest 8.0.0.7. Woudl anyone please let me know where I can find some info about it?

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

Re: Problems with the downsample function

Post by Narcís » Tue Nov 17, 2009 8:26 am

Hi David,

You'll find a little explanation here.

A couple examples are those:

Code: Select all

Private Sub Form_Load()
    With TChart1
        .Aspect.View3D = False
        .AddSeries scPoint
        
        Dim tmp As Date
        tmp = Now
        
        For i = 0 To 200
            .Series(0).AddXY tmp + i / 24, Rnd, "", clTeeColor
        Next
        
        .Series(0).XValues.DateTime = True
        .Series(0).asPoint.Pointer.VerticalSize = 1
        .Series(0).asPoint.Pointer.HorizontalSize = 1
        .Series(0).asPoint.Pointer.Pen.Visible = False
        .AddSeries scLine
        .Series(1).SetFunction tfDownSampleFun
        '.Series(1).FunctionType.asDownSampling.Tolerance = 4
        .Series(1).FunctionType.asDownSampling.DisplayedPointCount = .Series(0).Count * 0.8
        .Series(1).FunctionType.asDownSampling.DownSampleMethod = dsAverage
        .Series(1).DataSource = TChart1.Series(0)
    End With
End Sub
The example below allows zooming the function taking DisplayedPointCount into account.

Code: Select all

Private Sub Form_Load()
    With TChart1
        .Aspect.View3D = False
        .Zoom.Direction = tzdHorizontal
        
        .AddSeries scPoint
        .AddSeries scFastLine
        
        For i = 0 To 20000
            If i Mod 20 = 0 Then
                .Series(0).AddNull ""
            Else
                .Series(0).Add Rnd * 100, "", clTeeColor
            End If
        Next
        
        .Series(0).Active = False
        
        .Series(1).asFastLine.TreatNulls = tnDontPaint
        .Series(1).DataSource = .Series(0)
        
        .Series(1).SetFunction tfDownSampleFun
        .Series(1).FunctionType.asDownSampling.DisplayedPointCount = 1000
        .Series(1).FunctionType.asDownSampling.DownSampleMethod = dsMinMax
    End With
End Sub

Private Sub TChart1_OnUndoZoom()
    TChart1.Axis.Bottom.SetMinMax 0, TChart1.Series(0).Count
    TChart1.Series(1).CheckDataSource
End Sub

Private Sub TChart1_OnZoom()
    TChart1.Series(1).CheckDataSource
End Sub
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