IMsTimeMatrix.AddSerie

Fore Syntax

AddSerie(Item: ITimeSeries);

Fore.NET Syntax

AddSerie(Item: Prognoz.Platform.Interop.Ms.TimeSeries);

Parameters

Item. Data series.

Description

The AddSerie method adds a series to matrix.

Comments

To remove a series from matrix, use the IMsTimeMatrix.DeleteSerie method.

Fore Example

This example describes custom method.

To execute the example, add links to the Ms, Transform, Dimensions system assemblies.

Public Function CreateEx(param: ITimeSeries): Variant;
Var 
    CalendSett: ITsCalendarSettings;
    m : IMsTimeMatrix;
    i, j: Integer;
    s : String;
    serie : ITimeSeries;
Begin
    CalendSett := New MsCalendarSettings.Create;
    CalendSett.RestDays := DayOfWeekSet.SaturdaySunday;
    CalendSett.FirstDay := DayOfWeekSet.Monday;
    m := New MsTimeMatrix.CreateEx(DimCalendarLevel.Day, CalendSett);
    If param.EndDate > DateTime.Now Then
        m.Clear;
        m.AddSerie(param);
        Debug.WriteLine("Series: " + m.Count.ToString);
        For i := 0 To m.Count - 1 Do
            s := "";
            serie := m.Item(i);
            For j := m.StartIndex To m.EndIndex Do
                s := s + (serie.Item(j) As double).ToString + " ";
            End For;
            Debug.WriteLine("Series: " + i.ToString + " - " + s);
        End For;
    End If;
    Return m;
End Function CreateEx;

The method adds series to matrix. After that the console window displays resulting matrix series.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.Transform;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Fore;

Public Function CreateEx(param: TimeSeries): object;
Var 
    CalendSett: ITsCalendarSettings;
    m : IMsTimeMatrix;
    i, j: Integer;
    s : String;
    serie : ITimeSeries;
Begin
    CalendSett := New MsCalendarSettings.Create();
    CalendSett.RestDays := DayOfWeekSet.dowsSaturdaySunday;
    CalendSett.FirstDay := DayOfWeekSet.dowsMonday;
    m.CreateEx(DimCalendarLevel.dclDay, CalendSett As TsCalendarSettings, Null);
    If param.EndDate > DateTime.Now Then
        m.Clear();
        m.AddSerie(param);
        System.Diagnostics.Debug.WriteLine("Series: " + m.Count.ToString());
        For i := 0 To m.Count - 1 Do
            s := "";
            serie := m.Item[i];
            For j := m.StartIndex To m.EndIndex Do
                s := s + (serie.Item[j] As double).ToString() + " ";
            End For;
            System.Diagnostics.Debug.WriteLine("Series: " + i.ToString() + " - " + s);
        End For;
    End If;
    Return m;
End Function CreateEx;

See also:

IMsTimeMatrix