IChartCorridor.Background: IChartBackgroundInfo;
IChartCorridor.Background: Prognoz.Platform.Interop.Chart.ChartBackgroundInfo;
The Background property determines parameters of chart corridor fill.
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.
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(0, 2);
Corridor := UiChart1.Chart.Corridors.Item(i);
BackgroundInfo := New ChartBackgroundInfo.Create;
BackgroundInfo.Type := ChartBackgroundType.Gradient;
BackgroundInfo.Color := New GxColor.CreateARGB(255, 245, 120, 255);
Corridor.Background := BackgroundInfo;
End Sub Button1OnClick;
End Class OBJ761Form;
Clicking the Button1 button paints the corridor with a gradient lavender fill.
To execute the example, create a .NET form, add a button named Button1, the ChartBoxNet component named ChartBoxNet1, the uiChartNet component named UiChartNet1 on the form, specify UiChartNet1 as a data source of the ChartBoxNet component, and add links to the Chart, MathFin and Drawing system assemblies in the inspector of unit assemblies.
Imports System;
Imports System.Collections.Generic;
Imports System.ComponentModel;
Imports System.Data;
Imports System.Drawing;
Imports System.Text;
Imports System.Windows.Forms;
Imports Prognoz.Platform.Forms.Net;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Chart;
Imports Prognoz.Platform.Interop.MathFin;
Imports Prognoz.Platform.Interop.Drawing;
Public Partial Class OBJ765Form: Prognoz.Platform.Forms.Net.ForeNetForm
Public Constructor OBJ765Form();
Begin
InitializeComponent();
End Constructor;
Private Sub uiChartNet1_OnGetDataValue(Sender: System.Object; Args: Prognoz.Platform.Interop.Chart.UiChartGetDataValueEventArgs);
Var
Math: Prognoz.Platform.Interop.MathFin.Math = New MathClass();
Begin
Args.Result := True;
Args.Value := Math.Rand();
End Sub;
Private Sub OBJ765Form_Shown(sender: System.Object; e: System.EventArgs);
Var
Chart: IChart;
Begin
Chart := ChartBoxNet1.CtrlBox.Chart;
uiChartNet1.PointCount := 5;
uiChartNet1.SerieCount := 4
End Sub;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Corridor: IChartCorridor;
Background: ChartBackgroundInfo;
i: Integer;
c: GxColorClass_2 = New GxColorClass_2();
Begin
i := UiChartNet1.ChartUi.Chart.Corridors.Add[0, 2];
Corridor := UiChartNet1.ChartUi.Chart.Corridors.Item[i];
Background := New ChartBackgroundInfoClass();
Background.Type := ChartBackgroundType.cbtGradient;
c.CreateARGB(255, 245, 120, 255);
Background.Color := c;
Corridor.Background := Background;
End Sub;
End Class;
Clicking the Button1 button paints the corridor with a gradient lavender fill.
See also: