vcl-dxchartxydiagram-1e8cc32d.md
Stores axis value label appearance and behavior settings.
TdxChartAxisValueLabels = class(
TdxChartCustomLabels
)
Value labels mark values on an axis.
The list below outlines key members of the TdxChartAxisValueLabels class. These members allow you to configure axis value labels.
AngleRotates axis value labels clockwise or counterclockwise.AppearanceProvides access to general axis value label appearance settings.AssignCopies value label appearance and behavior settings between axes.MaxWidth | MaxLineCountLimit the width of value labels and the maximum number of text lines in them.PositionPositions value labels inside or outside the parent diagram area.ResolveOverlappingIndentAdjusts the offset used in the label overlap resolution algorithm.TextFormatAllows you to apply a formatting pattern to axis value labels.VisibleHides or displays axis value labels.
Tip
You can handle the parent diagram’s OnGetAxisValueLabelDrawParameters event to customize individual axis value labels.
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;
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();
}
The ValueLabels property of an axis references a TdxChartAxisValueLabels object.
TObject TPersistent TcxOwnedPersistent TcxOwnedInterfacedPersistent TdxChartVisualElementPersistent TdxChartCustomLabels TdxChartAxisValueLabels
See Also
TdxChartCrosshairAxisLabels Class
TdxChartSeriesValueLabels Class
TdxChartXYSeriesValueLabels Class