Skip to main content

TdxChartHitTest.Legend Property

Provides access to the legend pane to which the inspected point belongs.

Declaration

property Legend: TdxChartCustomLegend read;

Property Value

Type Description
TdxChartCustomLegend

The currently inspected legend pane. Cast the property value to the corresponding terminal legend class to access all public API members.

Call the Legend.ClassType function to identify the actual legend class.

This property returns nil (in Delphi) or nullptr (in C++Builder) if the inspected point is not within the area occupied by a chart or diagram legend pane.

Remarks

You can use the Legend property to identify and access a chart or diagram legend pane at the inspected point; that is, when the HitCode property returns one of the following values:

Legend

The inspected point is within a chart or diagram legend pane.

You can use the Legend property to access the inspected legend pane.

  • If the inspected legend pane belongs to the Chart control, you can cast the Legend property value to the TdxChartLegend class to access all public API members of the inspected legend pane.
  • If the inspected legend pane belongs to a diagram, you can cast the Legend property value to the TdxChartDiagramLegend class to access all public API members of the inspected legend pane.
LegendItem

The inspected point belongs to a legend item in a chart or diagram legend pane.

You can use LegendItem and Legend properties to access the inspected legend item and its parent legend pane, respectively.

  • If the parent legend pane of the inspected legend item belongs to the Chart control, you can cast the Legend property value to the TdxChartLegend class to access all public API members of the parent legend pane.
  • If the parent legend pane of the inspected legend item belongs to a diagram, you can cast the Legend property value to the TdxChartDiagramLegend class to access all public API members of the parent legend pane.
See Also