Page 1 of 1

TMedianTeeFunction problem

Posted: Fri Oct 21, 2005 9:11 am
by 9337158
Hello,

I try to use the TMedianTeeFunction function.
I have an ERange error in the AddValue function.

My sample code :

Code: Select all

  Series1.XValues.DateTime := True;

  MedianFunction := TMedianTeeFunction.Create(Chart1);

  MedianFunction.PeriodStyle := psRange;
  MedianFunction.PeriodAlign := paCenter;
  MedianFunction.IncludeNulls := False;
  MedianFunction.Period := DateTimeStep[ dtOneDay ];

  Series2.SetFunction(MedianFunction);

  Series2.DataSource := Series1;
  Series2.CheckDataSource;
When i use TAverageTeeFunction it work's properly with the same parameters.



Regards

Bug in function TCustomSortedFunction.Calculate

Posted: Fri Oct 21, 2005 12:36 pm
by 9337158
Hello,

In the teeFuncI unit, function CustomSortedFunction.Calculate, i replaced :

Code: Select all

AddValue(SourceSeries.MandatoryValueList.Value[t],t); 

by 

AddValue(SourceSeries.MandatoryValueList.Value[t],t-FirstIndex); 
  
and it work's properly.
Is it possible to test this ?

Regards

Posted: Fri Oct 21, 2005 2:08 pm
by narcis
Hi stsl,

I'm not able to reproduce the problem you reported here using latest TeeChart version available at our Customer Download Area, which is v7.05, and this code:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var MedianFunction: TMedianTeeFunction;
begin
  Series1.FillSampleValues();

  Series1.XValues.DateTime := True;

  MedianFunction := TMedianTeeFunction.Create(Chart1);

  MedianFunction.PeriodStyle := psRange;
  MedianFunction.PeriodAlign := paCenter;
  MedianFunction.IncludeNulls := False;
  MedianFunction.Period := DateTimeStep[ dtOneDay ];

  Series2.SetFunction(MedianFunction);

  Series2.DataSource := Series1;
  Series2.CheckDataSource;
end;
Which TeeChart version are you using? If you can reproduce it using v7.05, could you please send us an example we can run "as-is" to reproduce the problem here? You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.

Median

Posted: Fri Oct 21, 2005 3:02 pm
by 9337158
Hi,

I will put a sample on your site.
And there is an other problem with the TMedianTeeFunction.CalcResult if ICount = 1.

Regards

Median

Posted: Tue Oct 25, 2005 5:55 am
by 9337158
Hi,

I posted a sample on the newgroup.
Did you try my sample ?

Regards

Posted: Fri Oct 28, 2005 1:24 pm
by narcis
Hi stsl,

Thanks to your attached project we have been able to reproduce it. I've added your report to our defect list (TV52011063) to be looked carefully and be considered for inclusion in the next releases.