Back to Devexpress

TdxChartAxisValueLabelsAppearance Class

vcl-dxchartxydiagram-10c694c9.md

latest4.6 KB
Original Source

TdxChartAxisValueLabelsAppearance Class

Stores axis value appearance settings.

Declaration

delphi
TdxChartAxisValueLabelsAppearance = class(
    TdxChartCustomLabelsAppearance
)

Remarks

Value labels mark values on an axis. Use value label appearance settings to change font appearance, display label borders, and fill label areas.

Main API Members

The list below outlines key members of the TdxChartAxisValueLabelsAppearance class. These members allow you to customize value label appearance.

Appearance Settings

BorderSpecifies if the label border is visible.BorderThickness | BorderColorSpecify border thickness and color.FillOptionsProvides access to label background fill settings.FontOptions | TextColorAllow you to change font appearance.PaddingAllows you to adjust label paddings.

General-Purpose API Members

AssignCopies compatible general appearance settings between series and visual diagram elements.BeginUpdate | EndUpdate | CancelUpdateAllow you to avoid excessive redraw operations during batch appearance setting changes.

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();
  }

Direct TdxChartAxisValueLabelsAppearance Class References

The TdxChartAxisValueLabels.Appearance property references a TdxChartAxisValueLabelsAppearance object.

Inheritance

TObject TPersistent TcxOwnedPersistent TcxOwnedInterfacedPersistent TcxLockablePersistent TdxChartVisualElementAppearance TdxChartCustomLabelsAppearance TdxChartAxisValueLabelsAppearance

See Also

TdxChartSeriesValueLabelAppearance Class

TdxChartAxisValueLabelsAppearance Members

dxChartXYDiagram Unit