YOUSEFUL / DELPHI / COMPONENTS

TAtlasBoxHit

What TAtlasBoxPlot.HitTest found: the part, the category and, for an outlier, its index.

Record Unit Atlas.BoxPlot · Product Atlas Plot Pro

Description

Returned by TAtlasBoxPlot.HitTest. When nothing was hit, Part is bpNone and both indexes are -1.

Members

MemberKindWhat it does
PartfieldBox, whisker, outlier or none; see TAtlasBoxPart.
CategoryfieldIndex of the category hit, for CategoryName and Stats; -1 when nothing was hit.
OutlierfieldIndex 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.

pascal
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;

TAtlasBoxPlot · TAtlasBoxPart · TAtlasBoxStats

Also in Atlas Plot Pro

TAtlasBoxPlot · TAtlasHeatMap · TAtlasPolarPlot