Back to Devexpress

TdxChartCustomAxis.ValueLabels Property

vcl-dxchartxydiagram-dot-tdxchartcustomaxis-3368517c.md

latest3.5 KB
Original Source

TdxChartCustomAxis.ValueLabels Property

Provides access to axis value label appearance and behavior settings.

Declaration

delphi
property ValueLabels: TdxChartAxisValueLabels read; write;

Property Value

TypeDescription
TdxChartAxisValueLabels

Stores axis value label appearance and behavior settings.

|

Remarks

Value labels mark values on an axis.

Value Label Settings

You can use Ticks.LabelAlignment, ValueLabels.Position, and ValueLabels.Appearance properties to position axis value labels in a diagram and customize their appearance.

Refer to the TdxChartAxisValueLabels class description for information on all available options.

Tip

You can handle the parent diagram‘s OnGetAxisValueLabelDrawParameters event to customize individual axis value labels.

Code Example: Customize Axis Appearance

The following code example applies identical value label appearance settings to the main X and Y axes in a diagram:

delphi
var
  ADiagram: TdxChartXYDiagram;
begin
  if dxChartControl1.DiagramCount = 0 then Exit;
  ADiagram := dxChartControl1.Diagrams[0] as TdxChartXYDiagram;
  ADiagram.BeginUpdate;
  try
    ADiagram.Axes.AxisX.ValueLabels.Angle := 45;
    ADiagram.Axes.AxisX.ValueLabels.Appearance.FontOptions.Style := [fsBold, fsItalic];
    ADiagram.Axes.AxisX.ValueLabels.Appearance.TextColor := TdxAlphaColors.Gray;
    ADiagram.Axes.AxisY.Assign(ADiagram.Axes.AxisX); // Copies settings between axes
    ADiagram.Axes.AxisY.Interlaced := False; // Restores the previous Interlaced property value
  finally
    ADiagram.EndUpdate;
  end;
end;
cpp
TdxChartXYDiagram *ADiagram;
  // ...
  if(dxChartControl1->DiagramCount == 0) { return; }
  ADiagram = dynamic_cast<TdxChartXYDiagram*>(dxChartControl1->Diagrams[0]);
  ADiagram->BeginUpdate();
  try
  {
    ADiagram->Axes->AxisX->ValueLabels->Angle = 45;
    ADiagram->Axes->AxisX->ValueLabels->Appearance->FontOptions->Style = TFontStyles() << fsBold, << fsItalic;
    ADiagram->Axes->AxisX->ValueLabels->Appearance->TextColor = TdxAlphaColors::Gray;
    ADiagram->Axes->AxisY->Assign(ADiagram->Axes->AxisX); // Copies settings between axes
    ADiagram->Axes->AxisY->Interlaced = false; // Restores the previous Interlaced property value
  }
  __finally
  {
    ADiagram->EndUpdate();
  }

See Also

TdxChartCustomAxis.CrosshairLabels Property

TdxChartCustomAxis.Ticks Property

TdxChartXYSeriesCustomView.ValueLabels Property

TdxChartCustomAxis Class

TdxChartCustomAxis Members

dxChartXYDiagram Unit