IChartStyleAbsoluteGroup.Add

Fore Syntax

Add(SerieIdx: Integer; ToTheBeginning: Boolean): Integer;

Fore.NET Syntax

Add[SerieIdx: integer; ToTheBeginning: boolean]: integer;

Parameters

SerieIdx. Absolute index of a series.

ToTheBeginning. An indicator of locating a newly created relative group of series in the top or in the bottom of a list of groups of series. If the value is True, the group is located in the top.

Description

The Add method removes the specified series from a group. Then it creates new relative group and adds this series in it. After that the method returns the index of created group.

Comments

The method is outdated, use IChartStyleRelativeGroup.Move and IChartStyleRelativeGroup.MoveTo.

Absolute index of a series is an order number of the specified series among all series of chart.

Relative group is formed by summation of series values. In this case the totals chart looks like this:

Fore Example

Executing the example requires a form with the UiChart, ChartBox and Button components located on it with UiChart1, ChartBox1 and Button1 identifiers correspondingly. UiChart1 component must be a data source for ChartBox1 component and it must have the Mixed type of a scale for a chart.

The example is an event handler for a button.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Chart: IChart;
    ChartS: IChartStyleAbsoluteGroup;
    SerieC: IChartSerie;
    RIndex: Integer;
Begin
    Chart := ChartBox1.Chart;
    Chart.Style := ChartStyle.Mixed;
    ChartS := Chart.StyleGroup;
    SerieC := Chart.Series.Item(0);
    RIndex := ChartS.RelativeIndexOf(SerieC);
    ChartS.Add(RIndex, True).ToString;
End Sub Button1OnClick;

After executing the example a specified series is removed from its group and placed to a newly created relative group of series, located in the top of the list of series groups. Also the index of newly created relative group of series is obtained.

Fore.NET Example

Executing the example requires a form with the UiChartNet, ChartBoxNet and Button components located on it with UiChartNet1, ChartBoxNet1 and Button1 identifiers correspondingly. UiChartNet1 component must be a data source for ChartBoxNet1 component and it must have the Mixed type of a scale for a chart.

The example is an event handler for a button.

Imports Prognoz.Platform.Interop.Chart;
...
Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    Chart: IChart;
    ChartS: IChartStyleAbsoluteGroup;
    SerieC: IChartSerie;
    RIndex: Integer;
Begin
    Chart := ChartBoxNet1.CtrlBox.Chart;
    Chart.Style := ChartStyle.chsMixed;
    ChartS := Chart.StyleGroup;
    SerieC := Chart.Series.Item[0];
    RIndex := ChartS.RelativeIndexOf[SerieC];
    ChartS.Add(RIndex, True).ToString();
End Sub;

After executing the example a specified series is removed from its group and placed to a newly created relative group of series, located in the top of the list of series groups. Also the index of newly created relative group of series is obtained.

See also:

IChartStyleAbsoluteGroup