Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 2040

Summary: Wrong calculation for Median function
Product: VCL TeeChart Reporter: yeray alonso <yeray>
Component: FunctionsAssignee: yeray alonso <yeray>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: ---    
Version: 24.180321   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

Description yeray alonso 2018-06-11 09:22:43 EDT
In the example below, the mean should be 3 but it's giving 3.5:

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Series1:=Chart1.AddSeries(TBoxSeries) as TBoxSeries;

  for i:=1 to 5 do
    Series1.Add(i);

  Memo1.Clear;

  with Chart1.Tools.Add(TSeriesStatsTool) as TSeriesStatsTool do
  begin
    Series:=Series1;
    Statistics(Memo1.Lines);
  end;
end;