WPF Downsampling - Problem with CalcPosPoint
WPF Downsampling - Problem with CalcPosPoint
Hi,
I setup two series as below:
DownSampling sampling = new DownSampling();
Point s1 = new Point();
Line s2 = new Line();
chart.Add(s1);
chart.Add(s2);
s1.Add(xValues, yValues)
s2.DataSource = s1;
s2.Function = sampling;
Should I change the the bold code to s1.DataSource = yValues (i.e. not to specify xValues), downsampling would work properly.
In my investigation, it seems that when both xValues and yValues are specified explicitly, the function CalcPosPoint not returning the right value. Would it be possible that bold code have problem:
tmp *= iRange / IAxisSize;
The code above does not consider xValues when it is specified specifically.
I setup two series as below:
DownSampling sampling = new DownSampling();
Point s1 = new Point();
Line s2 = new Line();
chart.Add(s1);
chart.Add(s2);
s1.Add(xValues, yValues)
s2.DataSource = s1;
s2.Function = sampling;
Should I change the the bold code to s1.DataSource = yValues (i.e. not to specify xValues), downsampling would work properly.
In my investigation, it seems that when both xValues and yValues are specified explicitly, the function CalcPosPoint not returning the right value. Would it be possible that bold code have problem:
tmp *= iRange / IAxisSize;
The code above does not consider xValues when it is specified specifically.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi ltang,
Could you please let us know the TeeChart build number you are using and the exact code that works fine for you?
Thanks in advance.
Could you please let us know the TeeChart build number you are using and the exact code that works fine for you?
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 |
Instructions - How to post in this forum |
I am using:
Release Notes 23rd September 2008
TeeChart.NET version 3
Build 3.5.3188.18562
The above code works fine.
When I change from rawSeries.Add(yPoints); to rawSeries.Add(xPoints, yPoints);, DownSampling no longer gives the same output as before.
Release Notes 23rd September 2008
TeeChart.NET version 3
Build 3.5.3188.18562
Code: Select all
Points rawSeries = new Points();
Line reduceSeries = new Line();
tChart.Series.Add(rawSeries );
tChart.Series.Add(reduceSeries);
DownSampling sampling = new DownSampling(tChart.Chart);
sampling.DisplayedPointCount = 500;
reduceSeries .Function = sampling;
reduceSeries .DataSource = rawSeries ;
Array xPoints, yPoints;
....
//Populate X and Y with 3000 points
...
rawSeries.Add(yPoints);
reduceSeries .CheckDataSource();
When I change from rawSeries.Add(yPoints); to rawSeries.Add(xPoints, yPoints);, DownSampling no longer gives the same output as before.
Actually I have found that the problem in DownSampling.cs where Tolerance is calculated based on DisplayedPointCount.
when the array XValues is not specified, e.g, series.Add(YValues), the N in the code above would work.
When XValues is set, e.g., series.Add(XValues, YValues), the calculation of tolerance does not take into account XValues and hence the output of downsampling is no longer valid (under sampling or over sampling).
Code: Select all
if (DisplayedPointCount > 0)
{
tmpTol = DisplayedPointCount / 4.0;
tmpTol = N / tmpTol;
}
When XValues is set, e.g., series.Add(XValues, YValues), the calculation of tolerance does not take into account XValues and hence the output of downsampling is no longer valid (under sampling or over sampling).
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi ltang,
Thanks for the information but we are not able to reproduce the issue here. Would you be so kind to send us a simple example project we can run "as-is" to reproduce the issue here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Thanks for the information but we are not able to reproduce the issue here. Would you be so kind to send us a simple example project we can run "as-is" to reproduce the issue here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
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 |
Instructions - How to post in this forum |
Hi Narcisnarcis wrote:Hi ltang,
Thanks for the information but we are not able to reproduce the issue here. Would you be so kind to send us a simple example project we can run "as-is" to reproduce the issue here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
I have uploaded a zip file containing screen captures describing when DownSampling's OK and when it is NOT ok.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi ltang,
Thanks for the images but could you please arrange a simple example project we can run "as-is" and let us know the exact steps we should follow to reproduce the problem here?
Thanks in advance.
Thanks for the images but could you please arrange a simple example project we can run "as-is" and let us know the exact steps we should follow to reproduce the problem here?
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 |
Instructions - How to post in this forum |
I have sent source code to public.attachments.
The code tries to show problem of downsampling. Look forwards to your comments. Thanks.
The code tries to show problem of downsampling. Look forwards to your comments. Thanks.
narcis wrote:Hi ltang,
Thanks for the images but could you please arrange a simple example project we can run "as-is" and let us know the exact steps we should follow to reproduce the problem here?
Thanks in advance.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi ltang,
Thanks for the example project.
The problem there is that your X values are descending. While when only adding Y values TeeChart automatically adds sequential ascending X values. DownSampling was not designed to work with ValueLists that were not ascending. I'll add your request to the wish-list to be considered for inclusion in future release.
Thanks for the example project.
The problem there is that your X values are descending. While when only adding Y values TeeChart automatically adds sequential ascending X values. DownSampling was not designed to work with ValueLists that were not ascending. I'll add your request to the wish-list to be considered for inclusion in future release.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi narcis,narcis wrote:Hi ltang,
Thanks for the example project.
The problem there is that your X values are descending. While when only adding Y values TeeChart automatically adds sequential ascending X values. DownSampling was not designed to work with ValueLists that were not ascending. I'll add your request to the wish-list to be considered for inclusion in future release.
Is there a tracking number so that I would know when problem would be resolved? Thanks.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi ltang,
Yes, it's TF02013471. However we don't consider this a bug, it's a feature request.
Yes, it's TF02013471. However we don't consider this a bug, it's a feature request.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |