YOUSEFUL / DELPHI / COMPONENTS
TAtlasBoxHit
What TAtlasBoxPlot.HitTest found: the part, the category and, for an outlier, its index.
Description
Returned by TAtlasBoxPlot.HitTest. When nothing was hit, Part is bpNone and both indexes are -1.
Members
| Member | Kind | What it does |
|---|---|---|
Part | field | Box, whisker, outlier or none; see TAtlasBoxPart. |
Category | field | Index of the category hit, for CategoryName and Stats; -1 when nothing was hit. |
Outlier | field | Index into Stats(Category).Outliers when Part is bpOutlier; -1 for other parts. |
Fields
Part field
Part: TAtlasBoxPart;Box, whisker, outlier or none; see TAtlasBoxPart.
Category field
Category: Integer;Index of the category hit, for CategoryName and Stats; -1 when nothing was hit.
Outlier field
Outlier: Integer;Index into Stats(Category).Outliers when Part is bpOutlier; -1 for other parts.
Examples
Describe a hit
Turns a hit into a status line.
uses
System.SysUtils, Atlas.BoxPlot;
function DescribeHit(Box: TAtlasBoxPlot; X, Y: Integer): string;
var Hit: TAtlasBoxHit;
begin
Hit := Box.HitTest(X, Y);
case Hit.Part of
bpBox: Result := Format('%s: median %.1f', [Box.CategoryName(Hit.Category), Box.Stats(Hit.Category).Median]);
bpWhisker: Result := Format('%s: whiskers %.1f to %.1f', [Box.CategoryName(Hit.Category),
Box.Stats(Hit.Category).LowWhisker, Box.Stats(Hit.Category).HighWhisker]);
bpOutlier: Result := Format('%s: outlier %.1f', [Box.CategoryName(Hit.Category),
Box.Stats(Hit.Category).Outliers[Hit.Outlier]]);
else
Result := '';
end;
end;Related
TAtlasBoxPlot · TAtlasBoxPart · TAtlasBoxStats