IChartAxis.TextHorizontalAlignment

Syntax

TextHorizontalAlignment: ChartHorizontalAlignment;

Description

The TextHorizontalAlignment property determines the horizontal position of multiline label text for the category axis.

Comments

The property is relevant only for the category axis and any attempt to set this property for other types of axes throws an exception. The default value is center.

The property is saved together with the chart.

Example

Executing the example requires a regular report with the Rep_1 identifier with a chart on the report sheet. The inspector of unit assemblies must contain links to the Chart, Report, Tab and Metabase system assemblies.

Sub macro;
Var
    mb: IMetabase;
    report: IPrxReport;
    chart: IChart;
    aX: IChartAxis;
Begin
    mb := MetabaseClass.Active;
    report := mb.ItemById("Rep_1").Edit As IPrxReport;
    chart := (report.ActiveSheet As IPrxTable).TabSheet.Objects.Item(0).Extension As IChart;
    aX := chart.AxisX;
    aX.TextHorizontalAlignment := ChartHorizontalAlignment.Right;
    (report As IMetabaseObject).Save;
End Sub macro;

After executing the example the label text is aligned to the right edge.

See also:

IChartAxis