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 - Wrong calculation for Median function
Summary: Wrong calculation for Median function
Status: RESOLVED FIXED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Functions (show other bugs)
Version: 24.180321
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: yeray alonso
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-11 09:22 EDT by yeray alonso
Modified: 2018-06-11 09:22 EDT (History)
0 users

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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;