Page 1 of 1

IDownSamplingFunction for decimal x values

Posted: Thu Dec 03, 2009 1:45 pm
by 15053905
Hi,
I am using TeeChart pro V8.0.0.6 Version v Active x, underC++
I am trying to limit thenumber of points dispalyed by using IDownSamplingFunction with the dsMinMax method:

m_Chart.Series(1).SetFunction(tfDownSampleFun);
m_Chart.Series(1).GetFunctionType().GetAsDownSampling().SetDownSampleMethod(dsMinMax);
m_Chart.Series(1).GetFunctionType().GetAsDownSampling().SetTolerance(10);
m_Chart.Series(1).SetDataSource(COleVariant("Series0"));

The probelm is that my X axis has decimal values lower than 1. The SetTolerance() accepts only integers. I understand that SetTolerance() limts the number of points by a range defined on the X axis, so how do I do it for a range lower than 1?

Is there a way to reduce the number of points used by defining on how many points will the dsMinMax operate instead of a range?

I read the topic "problems with the downsample function". Will the DisplayedPointCount property help?
I didn't find Set or Get for this property in version v8.0.0.6 and not in v8.0.0.7 which I just downloaded.

Thanks

Re: IDownSamplingFunction for decimal x values

Posted: Thu Dec 03, 2009 2:32 pm
by narcis
Hi yvb,
I read the topic "problems with the downsample function". Will the DisplayedPointCount property help?
Yes, I think DisplayedPointCount would help here. You can find similar discussions and examples here:

http://www.teechart.net/support/viewtop ... nce#p27480
http://www.teechart.net/support/viewtop ... nce#p39483
I didn't find Set or Get for this property in version v8.0.0.6 and not in v8.0.0.7 which I just downloaded
It's available in Visual Basic 6 but not in Visual C++. This is a defect I have added to the bug list (TA05014583) to be fixed for next releases.

Re: IDownSamplingFunction for decimal x values

Posted: Thu Oct 14, 2010 9:54 am
by narcis
Hi yvb,

As an update, we found that this already works fine using current TeeChart version so that you can do this now:

Code: Select all

    m_chart.AddSeries(4); 
    m_chart.Series(0).FillSampleValues(200); 
    m_chart.GetAspect().SetView3D(false); 
    m_chart.Series(0).GetAsPoint().GetPointer().SetVerticalSize(1); 
    m_chart.Series(0).GetAsPoint().GetPointer().SetHorizontalSize(1); 
    m_chart.Series(0).GetAsPoint().GetPointer().GetPen().SetVisible(false); 

    m_chart.AddSeries(0); 
    m_chart.Series(1).SetFunction(39); 
    m_chart.Series(1).GetFunctionType().GetAsDownSampling().SetTolerance(4); 
    m_chart.Series(1).GetFunctionType().GetAsDownSampling().SetDownSampleMethod(0); 
    m_chart.Series(1).SetDataSource(COleVariant("Series0")); 
    m_chart.Series(1).GetFunctionType().GetAsDownSampling().SetDisplayedPointCount(10);