Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxChartAxisValueLabels Class

Stores axis value label appearance and behavior settings.

#Declaration

Delphi
TdxChartAxisValueLabels = class(
    TdxChartCustomLabels
)

#Remarks

Value labels mark values on an axis.

VCL Chart Control: Value Labels on X and Y Axes

#Main API Members

The list below outlines key members of the TdxChartAxisValueLabels class. These members allow you to configure axis value labels.

Angle
Rotates axis value labels clockwise or counterclockwise.
Appearance
Provides access to general axis value label appearance settings.
Assign
Copies value label appearance and behavior settings between axes.
MaxWidth | MaxLineCount
Limit the width of value labels and the maximum number of text lines in them.
Position
Positions value labels inside or outside the parent diagram area.
ResolveOverlappingIndent
Adjusts the offset used in the label overlap resolution algorithm.
TextFormat
Allows you to apply a formatting pattern to axis value labels.
Visible
Hides or displays axis value labels.

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:

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;

VCL Chart Control: An Axis Value Label Customization Example

#Direct TdxChartAxisValueLabels Class References

The ValueLabels property of an axis references a TdxChartAxisValueLabels object.

See Also