public virtual void PopulateWithListChoices() { this.Clear(); //xxx is a dummy fieldname just to satisfy the constructor DoubleAggregateSummary sum = DoubleAggregateSummary.Empty;// new DoubleAggregateSummary(0, double.MaxValue, double.MinValue, 0d); this.Add(new PivotComputationInfo(sum, "Sum", "Sum of {*}", "xxx")); this.Add(new PivotComputationInfo(sum, "Average", "Average of {*}", "xxx")); DoubleVectorSummary v = DoubleVectorSummary.Empty;// new DoubleVectorSummary(new double[] { 1, 2, 3 }, 3);// any will do this.Add(new PivotComputationInfo(v, "Median", "Median of {*}", "xxx")); this.Add(new PivotComputationInfo(v, "Percentile25", "25 Percentile of {*}", "xxx")); this.Add(new PivotComputationInfo(v, "Percentile75", "75 Percentile of {*}", "xxx")); CountSummary c = CountSummary.Empty;// new VectorSummary(null, 0); this.Add(new PivotComputationInfo(c, "Count", "Count of {*}", "xxx")); DoubleStdDevSummary sd = DoubleStdDevSummary.Empty; this.Add(new PivotComputationInfo(sd, "StdDev", "StDev of {*}", "xxx")); this.Add(new PivotComputationInfo(sd, "StdDevP", "StDevP of {*}", "xxx")); this.Add(new PivotComputationInfo(sd, "Var", "Var of {*}", "xxx")); this.Add(new PivotComputationInfo(sd, "VarP", "VarP of {*}", "xxx")); }
private void UpdateDisplay() { //bool summaryChange; ISummary[] summaries = viewModel.TheTable.TopLevelGroup.GetSummaries(viewModel.TheTable); SummaryDescriptorCollection sdc = viewModel.TheTable.TableDescriptor.Summaries; int index = sdc.IndexOf(sdc["Int32Agg"]); Int32AggregateSummary summaryInt32Agg = summaries[index] as Int32AggregateSummary; viewModel.Lblauto = viewModel.TheTable.Records.Count.ToString(); viewModel.Lblavg = summaryInt32Agg.Average.ToString("F2"); index = sdc.IndexOf(sdc["Vect"]); DoubleVectorSummary summaryVector = summaries[index] as DoubleVectorSummary; viewModel.Lblmed = summaryVector.Median.ToString(); viewModel.Lblpeer25 = summaryVector.Percentile25.ToString(); viewModel.Lblper75 = summaryVector.Percentile75.ToString(); index = sdc.IndexOf(sdc["Int32Agg"]); int bucketCount = viewModel.TheTable.TopLevelGroup.Groups.Count; if (bucketCount > 3) { summaries = viewModel.TheTable.TopLevelGroup.Groups[3].GetSummaries(viewModel.TheTable); summaryInt32Agg = summaries[index] as Int32AggregateSummary; viewModel.Lblbuk3 = summaryInt32Agg.Count.ToString(); } else { // Less than 3 buckets ... viewModel.Lblbuk3 = "###"; } if (bucketCount > 56) { summaries = viewModel.TheTable.TopLevelGroup.Groups[56].GetSummaries(viewModel.TheTable); summaryInt32Agg = summaries[index] as Int32AggregateSummary; viewModel.Lblbuk56 = summaryInt32Agg.Count.ToString(); } else { // Less than 56 buckets ... viewModel.Lblbuk56 = "###"; } }