IMsModel.Chart

Syntax

Chart: IChart;

Description

The Chart property returns a model chart.

Comments

The chart is available only after model calculation by the IMsModel.Execute method.

Example

Executing the example requires a form containing the ChartBox component with the ChartBox1 identifier. The repository must contain a modeling container with the MS identifier that contains a model with the MODEL_D identifier.

Add links to the Metabase, Ms system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    MsKey: Integer;
    Model: IMsModel;
    Calcul: IMsModelCalculation;
    Per: IMsModelPeriod;
Begin
    // Get repository
    mb := MetabaseClass.Active;
    // Get modelling container key
    MsKey := mb.GetObjectKeyById("MS");
    // Get the model
    Model := mb.ItemByIdNamespace("MODEL_D", MsKey).Bind As IMsModel;
    // Create model calculation parameters
    Calcul := Model.CreateCalculation;
    // Set calculation period
    Per := Calcul.Period;
    Per.IdentificationStartDate := DateTime.Parse("01.01.1990");
    Per.IdentificationEndDate := DateTime.Parse("31.12.2010");
    Per.ForecastStartDate := DateTime.Parse("01.01.2011");
    Per.ForecastEndDate := DateTime.Parse("31.12.2015");
    // Calculate the model
    Model.Execute(Calcul, -1);
    // Display model chart in the ChartBox1 component
    ChartBox1.Chart := Model.Chart;
End Sub UserProc;

After executing the example the ChartBox1 component displays the MODEL_D model chart.

See also:

IMsModel