IChartPlacedItem.AutoMargin

Syntax

AutoMargin: Boolean;

Description

The AutoMargin property determines whether to use automatic margins for titles, axes and chart legends.

Comments

By default AutoMargin is set to True. The defined margins are not used, instead the value of margins is used at which the chart objects are drawn. By default the margin values for the chart objects are 1 mm.

This property is saved with the chart. If an object from the previous version is loaded, the AutoMargin and Margin properties are set by default.

Example

To execute this example, create a form with a button named Button1 on the form, the ChartBox component and the UiChart component that is a data source.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    c: IChart;
Begin
    c:= UiChart1.Chart;
    c.GraphArea.Margin:= New GxRectF.Create(0000);
    c.GraphArea.AutoMargin:= False;
    // the distance from the plot area (including labels and axes) to
    // chart margins = 0
    c.Legend.Margin:= New GxRectF.Create(01.000);
    c.Legend.AutoMargin:= False;
    // the distance from the legend to the bottom edge of the chart is 0
    // distance between the lower margin of plot area and chart = 1 mm
End Sub Button1OnClick;

Clicking the Button1 button sets the distance from the plot area (including labels and axes) to the edges of the chart that equals to zero, the distance from the legend to bottom of the chart that equals to zero, the distance between the bottom of the plot area and the legend that is equal to 1 mm.

See also:

IChartPlacedItem