Skip to main content
All docs
V24.1

TdxChartXYDiagram.SecondaryAxes Property

Provides access to secondary axes of arguments and values.

Declaration

property SecondaryAxes: TdxChartSecondaryAxes read; write;

Property Value

Type Description
TdxChartSecondaryAxes

Stores collections of secondary axes of arguments and values.

Remarks

Use SecondaryAxes.AxesX and SecondaryAxes.AxesY properties to add and configure supplemental axes for the main axis of arguments (X-axis) and the main axis of values (Y-axis). For example, secondary axes can be useful if you need to display multiple scales with different measurement units.

VCL Chart Control: A Secondary Axis of Values Example

Refer to the TdxChartSecondaryAxes class description for detailed information on available options.

Code Example

The following code example creates a secondary axis of values and associates it with the first series in an XY diagram:

var
  ADiagram: TdxChartXYDiagram;
  AAxisY: TdxChartSecondaryAxisYCollectionItem;
  AXYSeries: TdxChartXYSeries;
begin
  if dxChartControl1.DiagramCount = 0 then Exit;
  ADiagram := dxChartControl1.Diagrams[0] as TdxChartXYDiagram;
  if ADiagram.SeriesCount = 0 then Exit;
  AXYSeries := ADiagram.Series[0];
  AAxisY := ADiagram.SecondaryAxes.AxesY.Add;
  AXYSeries.View.AxisY := AAxisY.Axis;
  AAxisY.Title.Text := 'Income (USD)';
  AAxisY.Title.Alignment := TdxAlignment.Center;
  AAxisY.Appearance.Color := TdxAlphaColors.Gray;
end;
See Also