LazStats: Use TAChart in PlotXYUnit (old code still available after undefining USE_TACHART):

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7626 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-08-22 17:31:05 +00:00
parent 2379dbcfef
commit 8d74b6e07d
3 changed files with 395 additions and 516 deletions

View File

@ -2,3 +2,5 @@
{$DEFINE USE_EXTERNAL_HELP_VIEWER}
{$ENDIF}
{$DEFINE USE_TACHART}

View File

@ -5,7 +5,8 @@ unit Utils;
interface
uses
Classes, SysUtils, StdCtrls, Dialogs;
Classes, SysUtils, StdCtrls, Dialogs,
Globals;
function AnySelected(AListbox: TListBox): Boolean;
@ -16,6 +17,8 @@ procedure Exchange(var a, b: Double); overload;
procedure Exchange(var a, b: Integer); overload;
procedure Exchange(var a, b: String); overload;
procedure SortOnX(X, Y: DblDyneVec);
implementation
function AnySelected(AListBox: TListBox): Boolean;
@ -68,5 +71,26 @@ begin
b := tmp;
end;
procedure SortOnX(X, Y: DblDyneVec);
var
i, j, N: Integer;
begin
N := Length(X);
if N <> Length(Y) then
raise Exception.Create('[SortOnX] Both arrays must have the same length');
for i := 0 to N - 2 do
begin
for j := i + 1 to N - 1 do
begin
if X[i] > X[j] then //swap
begin
Exchange(X[i], X[j]);
Exchange(Y[i], Y[j]);
end;
end;
end;
end;
end.