AllStatistics: ITsStatisticsTree;
AllStatistics: Prognoz.Platform.Interop.Transform.ITsStatisticsTree;
The AllStatistics property returns all the summary statistics.
Use the IEaxStatistics.Statistics property to get only calculated summary statistics.
The form, that contains the following components, is required to execute an example:
The button with Button1 identifier.
The LanerBox with LanerBox1 identifier.
UiErAnalayzer with the UiErAnalayzer1 identifier is a data for LanerBox1. Workbook of the time series DB must be loaded to UiErAnalyzer1.
The TreeList with the TreeList1 identifier, that contains two buttons.
Add links to system assemblies: Collection, Transform.
An example is the OnClick event handler for the Button1 component.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
EaxStat: IEaxStatistics;
Tree: ITsStatisticsTree;
i: integer;
Nodes: ITreeListNodes;
StatNode, ParentNode: ITreeListNode;
HashT: IHashtable;
Begin
EaxStat := UiErAnalyzer1.ErAnalyzer.Statistics;
// Exclude a number of statistics from the tree build
EaxStat.StatisticsVisible(TsStatisticsType.Skew) := False;
EaxStat.StatisticsVisible(TsStatisticsType.Kurt) := False;
EaxStat.CustomStatisticsVisible(EaxCustomStatisticsType.Scale) := False;
// Obtain statistics
Tree := EaxStat.AllStatistics;
// Clear a component to display the statistics tree
Nodes := TreeList1.Nodes;
Nodes.Clear;
// Build the tree
If Tree = Null Then
Return;
End If;
HashT := New Hashtable.Create;
For i := 0 To Tree.Count - 1 Do
ParentNode := Null;
If Tree.ParentNode(i) <> -1 Then
ParentNode := HashT(Tree.ParentNode(i));
End If;
StatNode := Nodes.AddChild(ParentNode, Tree.Name(i));
If Tree.Type(i) <> TsStatisticsTreeNodeType.Category Then
StatNode.ColumnText(1) := Tree.Value(i);
End If;
StatNode.Data := i;
HashT(i) := StatNode;
End For;
HashT.Clear;
Nodes.TreeControl.InnerRoot.Expand(True);
End Sub Button1OnClick;
// Get statistics
Tree := EaxStat.AllStatistics;
// Clear component to output statistics tree
Nodes := TreeList1.Nodes;
Nodes.Clear;
// Build tree
If Tree = Null Then
Return;
End If;
HashT := New Hashtable.Create;
For i := 0 To Tree.Count - 1 Do
ParentNode := Null;
If Tree.ParentNode(i) <> -1 Then
ParentNode := HashT(Tree.ParentNode(i));
End If;
StatNode := Nodes.AddChild(ParentNode, Tree.Name(i));
If Tree.Type(i) <> TsStatisticsTreeNodeType.Category Then
StatNode.ColumnText(1) := Tree.Value(i);
End If;
StatNode.Data := i;
HashT(i) := StatNode;
End For;
HashT.Clear;
Nodes.TreeControl.InnerRoot.Expand(True);
End Sub Button1OnClick;
When example is executed, the tree of summary statistics, calculated for the data range and selected in the LanerBox1, is displayed in the treeListNet1.
The form, that contains the following components, is required to execute an example:
The button with button1 identifier.
The LanerBoxNet with thelanerBoxNet1 identifier.
uiErAnalayzerNet with uiErAnalayzerNet1 identifier is a data for lanerBoxNet1. The workbook of time series DB is to be loaded to the uiErAnalayzerNet1.
The TreeListNet with the treeListNet1 identifier, that contains two buttons.
An example is the Click event handler for the button1 component.
Imports Prognoz.Platform.Interop.ForeCollections;
Imports Prognoz.Platform.Interop.Transform;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Forms;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
EaxStat: IEaxStatistics;
Tree: ITsStatisticsTree;
i: integer;
Nodes: ITreeListNodes;
StatNode, ParentNode: ITreeListNode;
HashT: IHashtable;
Begin
EaxStat := uiErAnalyzerNet1.ErAnalyzer.ErAnalyzer.Statistics;
// Exclude part of statistics from tree building
EaxStat.StatisticsVisible[TsStatisticsType.tstSkew] := False;
EaxStat.StatisticsVisible[TsStatisticsType.tstKurt] := False;
EaxStat.CustomStatisticsVisible[EaxCustomStatisticsType.ecstScale] := False;
// Get statistics
Tree := EaxStat.AllStatistics;
// Clear component to output statistics tree
Nodes := treeListNet1.CtrlBox.Nodes;
Nodes.Clear();
// Build tree
If Tree = Null Then
Return;
End If;
HashT := New Hashtable.Create();
For i := 0 To Tree.Count - 1 Do
ParentNode := Null;
If Tree.ParentNode[i] <> -1 Then
ParentNode := HashT[Tree.ParentNode[i]] As ITreeListNode;
End If;
StatNode := Nodes.AddChild(ParentNode, Tree.Name[i]);
If Tree.Type[i] <> TsStatisticsTreeNodeType.tstntCategory Then
StatNode.ColumnText[1] := Tree.Value[i].ToString();
End If;
StatNode.Data := i;
HashT[i] := StatNode;
End For;
HashT.Clear();
Nodes.TreeControl.InnerRoot.Expand(True);
End Sub;
When example is executed, the tree of summary statistics, calculated for the data range and selected in the LanerBox1, is displayed in the treeListNet1.
See also: