AllStatistics: 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.
See also: