IMsTimeMatrix.AddSerie

Syntax

AddSerie(Item: ITimeSeries);

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.

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.

See also:

IMsTimeMatrix