Problems with the downsample function

TeeChart for ActiveX, COM and ASP
jer_m
Newbie
Newbie
Posts: 8
Joined: Tue Apr 25, 2006 12:00 am

Problems with the downsample function

Post by jer_m » Wed Dec 05, 2007 9:46 pm

I've been using TeeChart for .Net but am currently evaluating the ActiveX version for a new project. The ActiveX version seems to handle large amounts of data much more efficiently but I have run into a couple problems.

1. I can't seem to get the downsample function to work correctly when the x axis is set to Datetime. The only DownSampleMethod that results in something other then 1 or 2 datapoints is TeeChart.EDownSampleMethod.dsDouglas.
However the results from dsDouglas still appear to be wrong, there are large groups of data points which seem to be skipped.

This can easily be reproduced by changing the code of the 'Reducing Number of Points' demo.
Just change fillsamples to a loop calling addxy (adding datetimes) and configure the series to use datetimes.


2. Is there no equivalent in the ActiveX version to DisplayedPointCount. I found this property to be a much more effective way of limiting the user from information overload then the tolerance property. It also let the user step into the hidden data when zooming.

Kind regards,
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 » Fri Dec 07, 2007 10:38 am

Hi Jerron,

Please find below the answers to your questions:

1. Code below works fine for me here using TeeChart Pro v8.0.0.2 ActiveX which is the latest version available at the client area. Which version are you using exactly? Could you please modify the code below so that we can reproduce the problem here?

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, 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.DownSampleMethod = dsAverage
    .Series(1).DataSource = TChart1.Series(0)
  End With
End Sub
Thanks in advance.

2. You can try using this:

Code: Select all

    TChart1.Series(1).VisibleCount
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: 8
Joined: Tue Apr 25, 2006 12:00 am

Post by jer_m » Tue Dec 11, 2007 6:42 pm

Hi Narcis,

Thanks for the quick response.

I added the code in the sample project and it didn’t work. I am using v8.0.0.1.10507 so I am hoping it’s something that got fixed and not something I corrupted in the sample project. Would you mind testing with the older version as the version I have is the evaluation version and I can’t upgrade.

As for number 2 I don’t think I explained what I was looking for well enough.

TChart1.Series(1).VisibleCount appears to be a function call that returns the amount of data points that are currently shown on the graph.

In TeeChart For .Net there is a property in the downsampling function that can be used instead of Tolerance, that is the DisplayedPointCount property.
If I set this property to 1000 it limits the amount of data points shown to 1000.
If I have 20,000 or 30,000 data points and I zoom out all the way, I will see 1000 data points. Then when I zoom in to show half of the graph I still see 1000 data points.

There is an example of this in your TeeChart for .Net Examples in all features/functions/extended/reducing number of points/downsampling additions.

I found this to be a really handy property but I’m suspecting there is no such equivalent in your activex version. Hopefully I’m wrong and you can point me in the right direction. If not, what would that chances be of this being added to your activex version?

Best regards,
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 Dec 11, 2007 7:06 pm

Hi Jerron,
I added the code in the sample project and it didn’t work. I am using v8.0.0.1.10507 so I am hoping it’s something that got fixed and not something I corrupted in the sample project. Would you mind testing with the older version as the version I have is the evaluation version and I can’t upgrade.
This works fine for me here using the evaluation version, same build as you. You just need to drop a TeeChart in a VB form and add the code I posted in the form's OnLoad event.
I found this to be a really handy property but I’m suspecting there is no such equivalent in your activex version. Hopefully I’m wrong and you can point me in the right direction. If not, what would that chances be of this being added to your activex version?
Thanks for the information. I'm afraid this property doesn't exist in the ActiveX and VCL versions. I'll add your request to our wish-list to be implemented for future releases.
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: 8
Joined: Tue Apr 25, 2006 12:00 am

Post by jer_m » Wed Dec 12, 2007 6:39 pm

Hi Narcis,

I did a little more investigating, watch what happens to your same code when instead of adding days as your increments you add hours, i / 24
then minutes, then seconds, then milliseconds. The smaller the interval the more aggressive the downsamling function becomes. Eventually resulting in very few data points, 1 or 2 maybe.

This made me curious as to whether this would happen with the tolerance property in .Net version. I haven't had much time to debug it but you might want to take a look in there too because when I tried, my app started to freeze.

Best regards,
Jerron

jer_m
Newbie
Newbie
Posts: 8
Joined: Tue Apr 25, 2006 12:00 am

Post by jer_m » Tue Dec 18, 2007 5:55 pm

Hi Narcis,

Were you able to reproduce this?

Best regards,
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 » Wed Dec 19, 2007 8:58 am

Hi Jerron,

Sorry for the delayed reply. Yes, I was able to reproduce the issue here but we need some time to investigate it. We will get back to you ASAP.
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

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 Dec 21, 2007 10:05 am

Hi Jerron,

We have been investigating the issue here and we found that this only happens when using decimal DateTime values (interval smaller than one day). This seems a bug to us and added it (TV52012677) to our defect list to be fixed for future releases
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 Feb 13, 2008 9:45 pm

Hi Narcis,

I was wondering what the chances are of bumping the priority level up on the bug fix and possibly the DisplayedPointCount feature request.

Best regards,
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 » Thu Feb 14, 2008 11:17 am

Hi Jerron,

Ok, I've increased both issues priority on the list.
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 » Tue Jul 08, 2008 6:14 pm

Hi Narcis,

Can you let me know the status of these issue?

Were they addressed at all in the newest release, 8.0.0.4

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

Post by Narcís » Wed Jul 09, 2008 7:56 am

Hi jer_m,

No, any of them has been implemented yet.
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

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

Post by Narcís » Thu Jul 10, 2008 2:40 pm

Hi Jerron,

Find below an update on the status of the issues you requested.

1.
Downsampling does not work with decimal numbers


This is being reviewed now. When we have a fix available we will send you a pre-release version for tests.


2.
There is no DisplayedPointCount property as there is in the .Net version (this one is a feature request but seems to be a major oversight that this wasn’t included in the activex version)
The .NET DownSampling Function has been extensively on-developed as a result of projectwork specific to .NET. The DisplayedPointCount property is a minor part of the new functionality. We would expect to introduce the new features in the next major version upgrade for the ActiveX version.
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

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

Post by Narcís » Wed Jul 16, 2008 10:22 am

Hi Jerron,

Below there’s an update on the DownSampling issue:

We've done some tests to see where weaknesses might lie in the Downsampling's treatment of data. We may still be missing some aspects that apply to your projects but we think the key to satisfactory results lies with use of the Tolerance property. The NET and AX versions behave similarly with the same test data/settings.

As a benchmark the following works ok (same applies to VB or in C#, AX or NET versions):

Code: Select all

With TChart1
    .Series(0).Clear
    .Series(0).XValues.DateTime = False
    .Series(0).FillSampleValues (200) 'random fill
    
    For i = 0 To 199
      .Series(0).YValues.Value(i) = Rnd * 100
    Next i

    .Series(1).FunctionType.asDownSampling.Tolerance = 1
    .Series(1).FunctionType.asDownSampling.DownSampleMethod = dsDouglas
    .Series(1).CheckDataSource
  End With

Bringing down the Y value range (sub 1 values), the following fails to return more than 2 points in the function:

Code: Select all

With TChart1
    .Series(0).Clear
    .Series(0).XValues.DateTime = False
    .Series(0).FillSampleValues (200) 'random fill
    
    For i = 0 To 199
      .Series(0).YValues.Value(i) = Rnd * 1 '* 1 to focus that vals are < 1
    Next i

    .Series(1).FunctionType.asDownSampling.Tolerance = 1
    .Series(1).FunctionType.asDownSampling.DownSampleMethod = dsDouglas
    .Series(1).CheckDataSource
  End With 

Using that as a basis symptom to run checks, it becomes clear that tolerances of greater than 1 for sub 1 values won't give high function point returns. Tolerance should be adjusted to the sub 1 range:

eg. run same again but using:

Code: Select all

.Series(1).FunctionType.asDownSampling.Tolerance = 0.1

Returns a useable level of data points.

The key seems to be the value range of the Y values (or at least the range of values to which the DownSample is applied), not the X values, thus setting datetime to true shouldn't affect the result. (ie. .Series(0).XValues.DateTime = True does not affect result). As previously discussed, a DisplayedPointCount property in the AX version would simplify setting this up, so has been added as a feature request for the next major upgrade release. We will improve the documentation for the Tolerance property to help clarify it's use.
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

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 17, 2009 12:12 pm

Hello Jerron,

DownSampling function has now been implemented as it’s in v3 .NET for v8 VCL and ActiveX. This means DisplayedPointCount property has also been included. Those changes will be available in next maintenance release.

Fixing TV52012677 is a more complicated task as it would involve a redesign of DownSampling function.
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