Changeset 4721


Ignore:
Timestamp:
11/05/10 12:55:17 (9 years ago)
Author:
mkommend
Message:

Added possiblity to hide statistics of RunCollectionBoxPlotView (ticket #1135).

Location:
trunk/sources/HeuristicLab.Optimization.Views/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBoxPlotView.Designer.cs

    r4709 r4721  
    4646    private void InitializeComponent() {
    4747      this.components = new System.ComponentModel.Container();
    48       System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
    49       System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
     48      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
     49      System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
     50      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RunCollectionBoxPlotView));
    5051      this.xAxisLabel = new System.Windows.Forms.Label();
    5152      this.xAxisComboBox = new System.Windows.Forms.ComboBox();
     
    5556      this.noRunsLabel = new System.Windows.Forms.Label();
    5657      this.splitContainer = new System.Windows.Forms.SplitContainer();
     58      this.showStatisticsCheckBox = new System.Windows.Forms.CheckBox();
    5759      this.statisticsGroupBox = new System.Windows.Forms.GroupBox();
     60      this.statisticsMatrixView = new HeuristicLab.Data.Views.StringConvertibleMatrixView();
    5861      this.tooltip = new System.Windows.Forms.ToolTip(this.components);
    59       this.statisticsMatrixView = new HeuristicLab.Data.Views.StringConvertibleMatrixView();
    6062      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
    6163      this.splitContainer.Panel1.SuspendLayout();
     
    112114                  | System.Windows.Forms.AnchorStyles.Left)
    113115                  | System.Windows.Forms.AnchorStyles.Right)));
    114       chartArea2.Name = "ChartArea1";
    115       this.chart.ChartAreas.Add(chartArea2);
     116      chartArea1.Name = "ChartArea1";
     117      this.chart.ChartAreas.Add(chartArea1);
    116118      this.chart.Location = new System.Drawing.Point(6, 30);
    117119      this.chart.Name = "chart";
    118       series2.ChartArea = "ChartArea1";
    119       series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.BoxPlot;
    120       series2.IsVisibleInLegend = false;
    121       series2.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle;
    122       series2.Name = "DataSeries";
    123       series2.YValuesPerPoint = 6;
    124       this.chart.Series.Add(series2);
     120      series1.ChartArea = "ChartArea1";
     121      series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.BoxPlot;
     122      series1.IsVisibleInLegend = false;
     123      series1.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle;
     124      series1.Name = "DataSeries";
     125      series1.YValuesPerPoint = 6;
     126      this.chart.Series.Add(series1);
    125127      this.chart.Size = new System.Drawing.Size(534, 217);
    126128      this.chart.TabIndex = 17;
     
    148150      // splitContainer.Panel1
    149151      //
     152      this.splitContainer.Panel1.Controls.Add(this.showStatisticsCheckBox);
    150153      this.splitContainer.Panel1.Controls.Add(this.xAxisLabel);
    151154      this.splitContainer.Panel1.Controls.Add(this.noRunsLabel);
     
    161164      this.splitContainer.SplitterDistance = 277;
    162165      this.splitContainer.TabIndex = 23;
     166      //
     167      // showStatisticsCheckBox
     168      //
     169      this.showStatisticsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     170      this.showStatisticsCheckBox.Appearance = System.Windows.Forms.Appearance.Button;
     171      this.showStatisticsCheckBox.Checked = true;
     172      this.showStatisticsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
     173      this.showStatisticsCheckBox.Image = ((System.Drawing.Image)(resources.GetObject("showStatisticsCheckBox.Image")));
     174      this.showStatisticsCheckBox.Location = new System.Drawing.Point(6, 245);
     175      this.showStatisticsCheckBox.Name = "showStatisticsCheckBox";
     176      this.showStatisticsCheckBox.Size = new System.Drawing.Size(24, 24);
     177      this.showStatisticsCheckBox.TabIndex = 23;
     178      this.tooltip.SetToolTip(this.showStatisticsCheckBox, "Show/Hide Statistics");
     179      this.showStatisticsCheckBox.UseVisualStyleBackColor = true;
     180      this.showStatisticsCheckBox.CheckedChanged += new System.EventHandler(this.showStatisticsCheckBox_CheckedChanged);
    163181      //
    164182      // statisticsGroupBox
     
    219237    private System.Windows.Forms.GroupBox statisticsGroupBox;
    220238    private System.Windows.Forms.ToolTip tooltip;
     239    protected System.Windows.Forms.CheckBox showStatisticsCheckBox;
    221240  }
    222241}
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBoxPlotView.cs

    r4652 r4721  
    182182
    183183    private void UpdateStatistics() {
    184       DoubleMatrix matrix = new DoubleMatrix(6, seriesCache.Count);
     184      DoubleMatrix matrix = new DoubleMatrix(7, seriesCache.Count);
    185185      matrix.SortableView = false;
    186186      List<string> columnNames = new List<string>();
     
    207207      }
    208208      matrix.ColumnNames = columnNames;
    209       matrix.RowNames = new string[] { "Mean", "Median", "Standard deviation", "Variance", "25th percentile", "75th percentile" };
     209      matrix.RowNames = new string[] { "Count", "Average", "Median", "Standard Deviation", "Variance", "25th Percentile", "75th Percentile" };
    210210
    211211      for (int i = 0; i < seriesCache.Count; i++) {
    212212        Series series = seriesCache.ElementAt(i).Value;
    213213        double[] seriesValues = series.Points.Select(p => p.YValues[0]).OrderBy(d => d).ToArray();
    214         matrix[0, i] = seriesValues.Average();
    215         matrix[1, i] = seriesValues.Median();
    216         matrix[2, i] = seriesValues.StandardDeviation();
    217         matrix[3, i] = seriesValues.Variance();
    218         matrix[4, i] = seriesValues.Percentile(0.25);
    219         matrix[5, i] = seriesValues.Percentile(0.75);
     214        matrix[0, i] = seriesValues.Length;
     215        matrix[1, i] = seriesValues.Average();
     216        matrix[2, i] = seriesValues.Median();
     217        matrix[3, i] = seriesValues.StandardDeviation();
     218        matrix[4, i] = seriesValues.Variance();
     219        matrix[5, i] = seriesValues.Percentile(0.25);
     220        matrix[6, i] = seriesValues.Percentile(0.75);
    220221      }
    221222      statisticsMatrixView.Content = matrix;
     
    404405    #endregion
    405406
     407    private void showStatisticsCheckBox_CheckedChanged(object sender, EventArgs e) {
     408      splitContainer.Panel2Collapsed = !showStatisticsCheckBox.Checked;
     409    }
     410
    406411  }
    407412}
Note: See TracChangeset for help on using the changeset viewer.