IChartCorridor.Background

Syntax

IChartCorridor.Background: IChartBackgroundInfo;

Description

The Background property determines parameters of chart corridor fill.

Comments

The property enables the user to determine an image or hatching as the chart corridor fill.

The way the chart corridor is filled, also depends on the IChartCorridor.GradientFill and IChartCorridor.Color properties, that have a higher priority than Background property.

Example

To execute the example, create a form, add a button named Button1, the ChartBox component named ChartBox1, the UiChart component named UiChart1 on the form, specify UiChart1 as a data source of the ChartBox component, determine values of the PointCount and SerieCount properties for the UiChart component, and add links to the Chart, MathFin and Drawing system assemblies in the inspector of unit assemblies.

Class OBJ761Form: Form
    Button1: Button;
    ChartBox1: ChartBox;
    UiChart1: UiChart;
    
    Sub OBJ761FormOnShow(Sender: Object; Args: IEventArgs);
        Var
            Chart: IChart;
    Begin
        Chart := UiChart1.Chart;
        Chart.Type := ChartType.Lines;
    End Sub OBJ761FormOnShow;
    
    Sub UiChart1OnGetDataValue(Sender: Object; Args: IUiChartGetDataValueEventArgs);
    Begin
        Args.Result := True;
        Args.Value := Math.Rand;
    End Sub UiChart1OnGetDataValue;

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        Corridor: IChartCorridor;
        BackgroundInfo: IChartBackgroundInfo;
        i: Integer;
    Begin
        i := UiChart1.Chart.Corridors.Add(02);
        Corridor := UiChart1.Chart.Corridors.Item(i);
        BackgroundInfo := New ChartBackgroundInfo.Create;
        BackgroundInfo.Type := ChartBackgroundType.Gradient;
        BackgroundInfo.Color := New GxColor.CreateARGB(255245120255);
        Corridor.Background := BackgroundInfo;
    End Sub Button1OnClick;

End Class OBJ761Form;

Clicking the Button1 button paints the corridor with a gradient lavender fill.

See also:

IChart