- Timestamp:
- 06/27/17 10:06:34 (7 years ago)
- Location:
- trunk/sources
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis.Views/3.3/DataRowVisualPropertiesControl.Designer.cs
r14582 r15068 49 49 this.colorButton = new System.Windows.Forms.Button(); 50 50 this.startIndexZeroCheckBox = new System.Windows.Forms.CheckBox(); 51 this.binsNumericUpDown = new System.Windows.Forms.NumericUpDown();52 51 this.label1 = new System.Windows.Forms.Label(); 53 52 this.label2 = new System.Windows.Forms.Label(); 54 this.label3 = new System.Windows.Forms.Label();55 53 this.commonGroupBox = new System.Windows.Forms.GroupBox(); 56 54 this.clearColorButton = new System.Windows.Forms.Button(); … … 68 66 this.label6 = new System.Windows.Forms.Label(); 69 67 this.label9 = new System.Windows.Forms.Label(); 70 this.histoGramGroupBox = new System.Windows.Forms.GroupBox();71 this.binsExactRadioButton = new System.Windows.Forms.RadioButton();72 this.binsApproximatelyRadioButton = new System.Windows.Forms.RadioButton();73 this.label11 = new System.Windows.Forms.Label();74 this.aggregationComboBox = new System.Windows.Forms.ComboBox();75 68 this.lineChartGroupBox = new System.Windows.Forms.GroupBox(); 76 69 this.lineWidthNumericUpDown = new System.Windows.Forms.NumericUpDown(); … … 79 72 this.lineStyleComboBox = new System.Windows.Forms.ComboBox(); 80 73 this.label8 = new System.Windows.Forms.Label(); 81 ((System.ComponentModel.ISupportInitialize)(this.binsNumericUpDown)).BeginInit();82 74 this.commonGroupBox.SuspendLayout(); 83 75 this.axisGroupBox.SuspendLayout(); 84 76 this.panel2.SuspendLayout(); 85 77 this.panel1.SuspendLayout(); 86 this.histoGramGroupBox.SuspendLayout();87 78 this.lineChartGroupBox.SuspendLayout(); 88 79 ((System.ComponentModel.ISupportInitialize)(this.lineWidthNumericUpDown)).BeginInit(); … … 91 82 // chartTypeComboBox 92 83 // 93 this.chartTypeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 84 this.chartTypeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 94 85 | System.Windows.Forms.AnchorStyles.Right))); 95 86 this.chartTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; … … 126 117 this.startIndexZeroCheckBox.CheckedChanged += new System.EventHandler(this.startIndexZeroCheckBox_CheckedChanged); 127 118 // 128 // binsNumericUpDown129 //130 this.binsNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)131 | System.Windows.Forms.AnchorStyles.Right)));132 this.binsNumericUpDown.Location = new System.Drawing.Point(82, 19);133 this.binsNumericUpDown.Minimum = new decimal(new int[] {134 1,135 0,136 0,137 0});138 this.binsNumericUpDown.Name = "binsNumericUpDown";139 this.binsNumericUpDown.Size = new System.Drawing.Size(72, 20);140 this.binsNumericUpDown.TabIndex = 1;141 this.binsNumericUpDown.Value = new decimal(new int[] {142 1,143 0,144 0,145 0});146 this.binsNumericUpDown.ValueChanged += new System.EventHandler(this.binsNumericUpDown_ValueChanged);147 //148 119 // label1 149 120 // … … 164 135 this.label2.Text = "&Color:"; 165 136 // 166 // label3167 //168 this.label3.AutoSize = true;169 this.label3.Location = new System.Drawing.Point(6, 21);170 this.label3.Name = "label3";171 this.label3.Size = new System.Drawing.Size(30, 13);172 this.label3.TabIndex = 0;173 this.label3.Text = "&Bins:";174 //175 137 // commonGroupBox 176 138 // 177 this.commonGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 139 this.commonGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 178 140 | System.Windows.Forms.AnchorStyles.Right))); 179 141 this.commonGroupBox.Controls.Add(this.clearColorButton); … … 232 194 // displayNameTextBox 233 195 // 234 this.displayNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 196 this.displayNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 235 197 | System.Windows.Forms.AnchorStyles.Right))); 236 198 this.displayNameTextBox.Location = new System.Drawing.Point(102, 19); … … 242 204 // axisGroupBox 243 205 // 244 this.axisGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 245 | System.Windows.Forms.AnchorStyles.Left) 206 this.axisGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 207 | System.Windows.Forms.AnchorStyles.Left) 246 208 | System.Windows.Forms.AnchorStyles.Right))); 247 209 this.axisGroupBox.Controls.Add(this.panel2); … … 258 220 // panel2 259 221 // 260 this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 222 this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 261 223 | System.Windows.Forms.AnchorStyles.Right))); 262 224 this.panel2.Controls.Add(this.yAxisSecondaryRadioButton); … … 293 255 // panel1 294 256 // 295 this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 257 this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 296 258 | System.Windows.Forms.AnchorStyles.Right))); 297 259 this.panel1.Controls.Add(this.xAxisPrimaryRadioButton); … … 353 315 this.label9.Text = "&Name:"; 354 316 // 355 // histoGramGroupBox356 //357 this.histoGramGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)358 | System.Windows.Forms.AnchorStyles.Right)));359 this.histoGramGroupBox.Controls.Add(this.binsExactRadioButton);360 this.histoGramGroupBox.Controls.Add(this.binsApproximatelyRadioButton);361 this.histoGramGroupBox.Controls.Add(this.binsNumericUpDown);362 this.histoGramGroupBox.Controls.Add(this.label11);363 this.histoGramGroupBox.Controls.Add(this.label3);364 this.histoGramGroupBox.Controls.Add(this.aggregationComboBox);365 this.histoGramGroupBox.Location = new System.Drawing.Point(0, 305);366 this.histoGramGroupBox.Name = "histoGramGroupBox";367 this.histoGramGroupBox.Size = new System.Drawing.Size(327, 75);368 this.histoGramGroupBox.TabIndex = 2;369 this.histoGramGroupBox.TabStop = false;370 this.histoGramGroupBox.Text = "Histogram Properties";371 //372 // binsExactRadioButton373 //374 this.binsExactRadioButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));375 this.binsExactRadioButton.AutoSize = true;376 this.binsExactRadioButton.Location = new System.Drawing.Point(269, 19);377 this.binsExactRadioButton.Name = "binsExactRadioButton";378 this.binsExactRadioButton.Size = new System.Drawing.Size(52, 17);379 this.binsExactRadioButton.TabIndex = 3;380 this.binsExactRadioButton.TabStop = true;381 this.binsExactRadioButton.Text = "&Exact";382 this.binsExactRadioButton.UseVisualStyleBackColor = true;383 this.binsExactRadioButton.CheckedChanged += new System.EventHandler(this.binNumberRadioButton_CheckedChanged);384 //385 // binsApproximatelyRadioButton386 //387 this.binsApproximatelyRadioButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));388 this.binsApproximatelyRadioButton.AutoSize = true;389 this.binsApproximatelyRadioButton.Location = new System.Drawing.Point(173, 19);390 this.binsApproximatelyRadioButton.Name = "binsApproximatelyRadioButton";391 this.binsApproximatelyRadioButton.Size = new System.Drawing.Size(90, 17);392 this.binsApproximatelyRadioButton.TabIndex = 2;393 this.binsApproximatelyRadioButton.TabStop = true;394 this.binsApproximatelyRadioButton.Text = "&Approximately";395 this.binsApproximatelyRadioButton.UseVisualStyleBackColor = true;396 this.binsApproximatelyRadioButton.CheckedChanged += new System.EventHandler(this.binNumberRadioButton_CheckedChanged);397 //398 // label11399 //400 this.label11.AutoSize = true;401 this.label11.Location = new System.Drawing.Point(6, 49);402 this.label11.Name = "label11";403 this.label11.Size = new System.Drawing.Size(67, 13);404 this.label11.TabIndex = 0;405 this.label11.Text = "Aggregation:";406 //407 // aggregationComboBox408 //409 this.aggregationComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)410 | System.Windows.Forms.AnchorStyles.Right)));411 this.aggregationComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;412 this.aggregationComboBox.FormattingEnabled = true;413 this.aggregationComboBox.Location = new System.Drawing.Point(82, 45);414 this.aggregationComboBox.Name = "aggregationComboBox";415 this.aggregationComboBox.Size = new System.Drawing.Size(239, 21);416 this.aggregationComboBox.TabIndex = 3;417 this.aggregationComboBox.SelectedValueChanged += new System.EventHandler(this.aggregationComboBox_SelectedValueChanged);418 //419 317 // lineChartGroupBox 420 318 // 421 this.lineChartGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 319 this.lineChartGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 422 320 | System.Windows.Forms.AnchorStyles.Right))); 423 321 this.lineChartGroupBox.Controls.Add(this.lineWidthNumericUpDown); … … 436 334 // lineWidthNumericUpDown 437 335 // 438 this.lineWidthNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 336 this.lineWidthNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 439 337 | System.Windows.Forms.AnchorStyles.Right))); 440 338 this.lineWidthNumericUpDown.Location = new System.Drawing.Point(82, 66); … … 474 372 // lineStyleComboBox 475 373 // 476 this.lineStyleComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 374 this.lineStyleComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 477 375 | System.Windows.Forms.AnchorStyles.Right))); 478 376 this.lineStyleComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; … … 497 395 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 498 396 this.Controls.Add(this.lineChartGroupBox); 499 this.Controls.Add(this.histoGramGroupBox);500 397 this.Controls.Add(this.commonGroupBox); 501 398 this.Name = "DataRowVisualPropertiesControl"; 502 this.Size = new System.Drawing.Size(327, 382); 503 ((System.ComponentModel.ISupportInitialize)(this.binsNumericUpDown)).EndInit(); 399 this.Size = new System.Drawing.Size(327, 300); 504 400 this.commonGroupBox.ResumeLayout(false); 505 401 this.commonGroupBox.PerformLayout(); … … 510 406 this.panel1.ResumeLayout(false); 511 407 this.panel1.PerformLayout(); 512 this.histoGramGroupBox.ResumeLayout(false);513 this.histoGramGroupBox.PerformLayout();514 408 this.lineChartGroupBox.ResumeLayout(false); 515 409 this.lineChartGroupBox.PerformLayout(); … … 525 419 private System.Windows.Forms.Button colorButton; 526 420 private System.Windows.Forms.CheckBox startIndexZeroCheckBox; 527 private System.Windows.Forms.NumericUpDown binsNumericUpDown;528 421 private System.Windows.Forms.Label label1; 529 422 private System.Windows.Forms.Label label2; 530 private System.Windows.Forms.Label label3;531 423 private System.Windows.Forms.GroupBox commonGroupBox; 532 private System.Windows.Forms.GroupBox histoGramGroupBox;533 424 private System.Windows.Forms.RadioButton xAxisSecondaryRadioButton; 534 425 private System.Windows.Forms.RadioButton yAxisSecondaryRadioButton; … … 540 431 private System.Windows.Forms.Label label4; 541 432 private System.Windows.Forms.Label label7; 542 private System.Windows.Forms.RadioButton binsExactRadioButton;543 private System.Windows.Forms.RadioButton binsApproximatelyRadioButton;544 433 private System.Windows.Forms.ComboBox lineStyleComboBox; 545 434 private System.Windows.Forms.Label label8; … … 552 441 private System.Windows.Forms.Label label10; 553 442 private System.Windows.Forms.CheckBox isVisibleInLegendCheckBox; 554 private System.Windows.Forms.Label label11;555 private System.Windows.Forms.ComboBox aggregationComboBox;556 443 private System.Windows.Forms.Button clearColorButton; 557 444 } -
trunk/sources/HeuristicLab.Analysis.Views/3.3/DataRowVisualPropertiesControl.cs
r14582 r15068 46 46 chartTypeComboBox.DataSource = Enum.GetValues(typeof(DataRowVisualProperties.DataRowChartType)); 47 47 lineStyleComboBox.DataSource = Enum.GetValues(typeof(DataRowVisualProperties.DataRowLineStyle)); 48 aggregationComboBox.DataSource = Enum.GetValues(typeof(DataRowVisualProperties.DataRowHistogramAggregation));49 48 clearColorButton.BackColor = Color.Transparent; 50 49 clearColorButton.BackgroundImage = VSImageLibrary.Delete; … … 66 65 startIndexZeroCheckBox.Checked = false; 67 66 lineWidthNumericUpDown.Value = 1; 68 binsNumericUpDown.Value = 1;69 binsApproximatelyRadioButton.Checked = false;70 binsExactRadioButton.Checked = false;71 aggregationComboBox.SelectedIndex = -1;72 67 displayNameTextBox.Text = String.Empty; 73 68 } else { … … 91 86 lineWidthNumericUpDown.Value = lineWidthNumericUpDown.Maximum; 92 87 else lineWidthNumericUpDown.Value = Content.LineWidth; 93 if (Content.Bins < binsNumericUpDown.Minimum)94 binsNumericUpDown.Value = binsNumericUpDown.Minimum;95 else if (Content.Bins > binsNumericUpDown.Maximum)96 binsNumericUpDown.Value = binsNumericUpDown.Maximum;97 else binsNumericUpDown.Value = Content.Bins;98 binsApproximatelyRadioButton.Checked = !Content.ExactBins;99 binsExactRadioButton.Checked = Content.ExactBins;100 aggregationComboBox.SelectedItem = Content.Aggregation;101 88 displayNameTextBox.Text = Content.DisplayName; 102 89 isVisibleInLegendCheckBox.Checked = Content.IsVisibleInLegend; … … 110 97 clearColorButton.Visible = Content != null && !Content.Color.IsEmpty; 111 98 lineChartGroupBox.Enabled = Content != null && Content.ChartType == DataRowVisualProperties.DataRowChartType.Line; 112 histoGramGroupBox.Enabled = Content != null && Content.ChartType == DataRowVisualProperties.DataRowChartType.Histogram;113 99 isVisibleInLegendCheckBox.Enabled = Content != null; 114 100 } … … 187 173 } 188 174 189 private void binsNumericUpDown_ValueChanged(object sender, EventArgs e) {190 if (!SuppressEvents && Content != null) {191 Content.Bins = (int)binsNumericUpDown.Value;192 }193 }194 195 private void binNumberRadioButton_CheckedChanged(object sender, EventArgs e) {196 if (!SuppressEvents && Content != null) {197 SuppressEvents = true;198 try {199 Content.ExactBins = binsExactRadioButton.Checked;200 } finally { SuppressEvents = false; }201 }202 }203 204 private void aggregationComboBox_SelectedValueChanged(object sender, EventArgs e) {205 if (!SuppressEvents && Content != null) {206 SuppressEvents = true;207 try {208 Content.Aggregation = (DataRowVisualProperties.DataRowHistogramAggregation)aggregationComboBox.SelectedValue;209 } finally { SuppressEvents = false; }210 }211 }212 213 175 private void displayNameTextBox_Validated(object sender, EventArgs e) { 214 176 if (!SuppressEvents && Content != null) { -
trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableView.cs
r15042 r15068 206 206 break; 207 207 case DataRowVisualProperties.DataRowChartType.Histogram: 208 bool stacked = row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.Stacked;208 bool stacked = Content.VisualProperties.HistogramAggregation == DataTableVisualProperties.DataTableHistogramAggregation.Stacked; 209 209 series.ChartType = stacked ? SeriesChartType.StackedColumn : SeriesChartType.Column; 210 bool sideBySide = row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.SideBySide;210 bool sideBySide = Content.VisualProperties.HistogramAggregation == DataTableVisualProperties.DataTableHistogramAggregation.SideBySide; 211 211 series.SetCustomProperty("DrawSideBySide", sideBySide ? "True" : "False"); 212 212 series.SetCustomProperty("PointWidth", "1"); … … 330 330 private bool RequiresTransparency(DataRow row) { 331 331 return row.VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Histogram 332 && row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.Overlapping;332 && Content.VisualProperties.HistogramAggregation == DataTableVisualProperties.DataTableHistogramAggregation.Overlapping; 333 333 } 334 334 … … 349 349 ConfigureChartArea(chart.ChartAreas[0]); 350 350 RecalculateAxesScale(chart.ChartAreas[0]); // axes min/max could have changed 351 foreach (var row in Content.Rows.Where(r => r.VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Histogram)) 352 Row_VisualPropertiesChanged(row, EventArgs.Empty); // Histogram properties could have changed 353 chart.Update(); // side-by-side series are not always correctly displayed without an update 351 354 } 352 355 } … … 562 565 switch (row.VisualProperties.ChartType) { 563 566 case DataRowVisualProperties.DataRowChartType.Histogram: 564 // when a single histogram is updated, all histograms must be updated. otherwise the value ranges and bin sizesmay not be equal.567 // when a single histogram is updated, all histograms must be updated. otherwise the value ranges may not be equal. 565 568 var histograms = Content.Rows 566 569 .Where(r => r.VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Histogram) … … 606 609 if (!validValues.Any()) return; 607 610 608 int bins = histogramRows.Max(r => r.VisualProperties.Bins);611 int bins = Content.VisualProperties.HistogramBins; 609 612 decimal minValue = (decimal)validValues.Min(); 610 613 decimal maxValue = (decimal)validValues.Max(); … … 616 619 } 617 620 618 if (! histogramRows.Any(r => r.VisualProperties.ExactBins)) {621 if (!Content.VisualProperties.HistogramExactBins) { 619 622 intervalWidth = (decimal)HumanRoundRange((double)intervalWidth); 620 623 minValue = Math.Floor(minValue / intervalWidth) * intervalWidth; -
trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableVisualPropertiesControl.Designer.cs
r14185 r15068 105 105 this.label7 = new System.Windows.Forms.Label(); 106 106 this.label8 = new System.Windows.Forms.Label(); 107 this.histogramTabPage = new System.Windows.Forms.TabPage(); 108 this.histogramGroupBox = new System.Windows.Forms.GroupBox(); 109 this.histogramBinsExactRadioButton = new System.Windows.Forms.RadioButton(); 110 this.histogramBinsApproximatelyRadioButton = new System.Windows.Forms.RadioButton(); 111 this.histogramBinsNumericUpDown = new System.Windows.Forms.NumericUpDown(); 112 this.label16 = new System.Windows.Forms.Label(); 113 this.label17 = new System.Windows.Forms.Label(); 114 this.histogramAggregationComboBox = new System.Windows.Forms.ComboBox(); 107 115 this.titleTextBox = new System.Windows.Forms.TextBox(); 108 116 this.label15 = new System.Windows.Forms.Label(); … … 131 139 this.panel6.SuspendLayout(); 132 140 this.panel5.SuspendLayout(); 141 this.histogramTabPage.SuspendLayout(); 142 this.histogramGroupBox.SuspendLayout(); 143 ((System.ComponentModel.ISupportInitialize)(this.histogramBinsNumericUpDown)).BeginInit(); 133 144 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 134 145 this.SuspendLayout(); … … 489 500 this.axisTabControl.Controls.Add(this.xAxisTabPage); 490 501 this.axisTabControl.Controls.Add(this.yAxisTabPage); 502 this.axisTabControl.Controls.Add(this.histogramTabPage); 491 503 this.axisTabControl.Location = new System.Drawing.Point(0, 84); 492 504 this.axisTabControl.Name = "axisTabControl"; … … 791 803 this.label8.TabIndex = 2; 792 804 this.label8.Text = "&Minimum:"; 805 // 806 // histogramTabPage 807 // 808 this.histogramTabPage.Controls.Add(this.histogramGroupBox); 809 this.histogramTabPage.Location = new System.Drawing.Point(4, 22); 810 this.histogramTabPage.Name = "histogramTabPage"; 811 this.histogramTabPage.Padding = new System.Windows.Forms.Padding(3); 812 this.histogramTabPage.Size = new System.Drawing.Size(447, 263); 813 this.histogramTabPage.TabIndex = 2; 814 this.histogramTabPage.Text = "Histogram"; 815 this.histogramTabPage.UseVisualStyleBackColor = true; 816 // 817 // histogramGroupBox 818 // 819 this.histogramGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 820 | System.Windows.Forms.AnchorStyles.Right))); 821 this.histogramGroupBox.Controls.Add(this.histogramBinsExactRadioButton); 822 this.histogramGroupBox.Controls.Add(this.histogramBinsApproximatelyRadioButton); 823 this.histogramGroupBox.Controls.Add(this.histogramBinsNumericUpDown); 824 this.histogramGroupBox.Controls.Add(this.label16); 825 this.histogramGroupBox.Controls.Add(this.label17); 826 this.histogramGroupBox.Controls.Add(this.histogramAggregationComboBox); 827 this.histogramGroupBox.Location = new System.Drawing.Point(3, 3); 828 this.histogramGroupBox.Name = "histogramGroupBox"; 829 this.histogramGroupBox.Size = new System.Drawing.Size(441, 75); 830 this.histogramGroupBox.TabIndex = 2; 831 this.histogramGroupBox.TabStop = false; 832 this.histogramGroupBox.Text = "Histogram Properties"; 833 // 834 // histogramBinsExactRadioButton 835 // 836 this.histogramBinsExactRadioButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 837 this.histogramBinsExactRadioButton.AutoSize = true; 838 this.histogramBinsExactRadioButton.Location = new System.Drawing.Point(383, 19); 839 this.histogramBinsExactRadioButton.Name = "histogramBinsExactRadioButton"; 840 this.histogramBinsExactRadioButton.Size = new System.Drawing.Size(52, 17); 841 this.histogramBinsExactRadioButton.TabIndex = 3; 842 this.histogramBinsExactRadioButton.TabStop = true; 843 this.histogramBinsExactRadioButton.Text = "&Exact"; 844 this.histogramBinsExactRadioButton.UseVisualStyleBackColor = true; 845 this.histogramBinsExactRadioButton.CheckedChanged += new System.EventHandler(this.histogramBinsExactRadioButton_CheckedChanged); 846 // 847 // histogramBinsApproximatelyRadioButton 848 // 849 this.histogramBinsApproximatelyRadioButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 850 this.histogramBinsApproximatelyRadioButton.AutoSize = true; 851 this.histogramBinsApproximatelyRadioButton.Location = new System.Drawing.Point(287, 19); 852 this.histogramBinsApproximatelyRadioButton.Name = "histogramBinsApproximatelyRadioButton"; 853 this.histogramBinsApproximatelyRadioButton.Size = new System.Drawing.Size(90, 17); 854 this.histogramBinsApproximatelyRadioButton.TabIndex = 2; 855 this.histogramBinsApproximatelyRadioButton.TabStop = true; 856 this.histogramBinsApproximatelyRadioButton.Text = "&Approximately"; 857 this.histogramBinsApproximatelyRadioButton.UseVisualStyleBackColor = true; 858 // 859 // histogramBinsNumericUpDown 860 // 861 this.histogramBinsNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 862 | System.Windows.Forms.AnchorStyles.Right))); 863 this.histogramBinsNumericUpDown.Location = new System.Drawing.Point(82, 19); 864 this.histogramBinsNumericUpDown.Minimum = new decimal(new int[] { 865 1, 866 0, 867 0, 868 0}); 869 this.histogramBinsNumericUpDown.Name = "histogramBinsNumericUpDown"; 870 this.histogramBinsNumericUpDown.Size = new System.Drawing.Size(186, 20); 871 this.histogramBinsNumericUpDown.TabIndex = 1; 872 this.histogramBinsNumericUpDown.Value = new decimal(new int[] { 873 1, 874 0, 875 0, 876 0}); 877 this.histogramBinsNumericUpDown.ValueChanged += new System.EventHandler(this.histogramBinsNumericUpDown_ValueChanged); 878 // 879 // label16 880 // 881 this.label16.AutoSize = true; 882 this.label16.Location = new System.Drawing.Point(6, 49); 883 this.label16.Name = "label16"; 884 this.label16.Size = new System.Drawing.Size(67, 13); 885 this.label16.TabIndex = 0; 886 this.label16.Text = "Aggregation:"; 887 // 888 // label17 889 // 890 this.label17.AutoSize = true; 891 this.label17.Location = new System.Drawing.Point(6, 21); 892 this.label17.Name = "label17"; 893 this.label17.Size = new System.Drawing.Size(30, 13); 894 this.label17.TabIndex = 0; 895 this.label17.Text = "&Bins:"; 896 // 897 // histogramAggregationComboBox 898 // 899 this.histogramAggregationComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 900 | System.Windows.Forms.AnchorStyles.Right))); 901 this.histogramAggregationComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 902 this.histogramAggregationComboBox.FormattingEnabled = true; 903 this.histogramAggregationComboBox.Location = new System.Drawing.Point(82, 45); 904 this.histogramAggregationComboBox.Name = "histogramAggregationComboBox"; 905 this.histogramAggregationComboBox.Size = new System.Drawing.Size(353, 21); 906 this.histogramAggregationComboBox.TabIndex = 3; 907 this.histogramAggregationComboBox.SelectedValueChanged += new System.EventHandler(this.histogramAggregationComboBox_SelectedValueChanged); 793 908 // 794 909 // titleTextBox … … 927 1042 this.panel5.ResumeLayout(false); 928 1043 this.panel5.PerformLayout(); 1044 this.histogramTabPage.ResumeLayout(false); 1045 this.histogramGroupBox.ResumeLayout(false); 1046 this.histogramGroupBox.PerformLayout(); 1047 ((System.ComponentModel.ISupportInitialize)(this.histogramBinsNumericUpDown)).EndInit(); 929 1048 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 930 1049 this.ResumeLayout(false); … … 1005 1124 private System.Windows.Forms.CheckBox yAxisSecondaryLogScaleCheckBox; 1006 1125 private System.Windows.Forms.CheckBox yAxisPrimaryLogScaleCheckBox; 1126 private System.Windows.Forms.TabPage histogramTabPage; 1127 private System.Windows.Forms.GroupBox histogramGroupBox; 1128 private System.Windows.Forms.RadioButton histogramBinsExactRadioButton; 1129 private System.Windows.Forms.RadioButton histogramBinsApproximatelyRadioButton; 1130 private System.Windows.Forms.NumericUpDown histogramBinsNumericUpDown; 1131 private System.Windows.Forms.Label label16; 1132 private System.Windows.Forms.Label label17; 1133 private System.Windows.Forms.ComboBox histogramAggregationComboBox; 1007 1134 } 1008 1135 } -
trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableVisualPropertiesControl.cs
r14185 r15068 20 20 #endregion 21 21 22 using System; 23 using System.Drawing; 24 using System.Windows.Forms; 22 25 using HeuristicLab.MainForm; 23 26 using HeuristicLab.MainForm.WindowsForms; 24 using System.Drawing;25 using System.Windows.Forms;26 27 27 28 namespace HeuristicLab.Analysis.Views { … … 58 59 errorProvider.SetIconPadding(yAxisSecondaryMinimumFixedTextBox, 2); 59 60 errorProvider.SetIconPadding(yAxisSecondaryMaximumFixedTextBox, 2); 61 histogramAggregationComboBox.DataSource = Enum.GetValues(typeof(DataTableVisualProperties.DataTableHistogramAggregation)); 60 62 } 61 63 … … 101 103 yAxisSecondaryMaximumFixedTextBox.Text = string.Empty; 102 104 yAxisSecondaryLogScaleCheckBox.Checked = false; 105 106 histogramBinsNumericUpDown.Value = 1; 107 histogramBinsApproximatelyRadioButton.Checked = false; 108 histogramBinsExactRadioButton.Checked = false; 109 histogramAggregationComboBox.SelectedIndex = -1; 103 110 } else { 104 111 titleFontLabel.Text = "( " + FormatFont(Content.TitleFont) + " )"; … … 139 146 yAxisSecondaryMaximumFixedTextBox.Text = Content.SecondYAxisMaximumFixedValue.ToString(); 140 147 yAxisSecondaryLogScaleCheckBox.Checked = Content.SecondYAxisLogScale; 148 149 if (Content.HistogramBins < histogramBinsNumericUpDown.Minimum) 150 histogramBinsNumericUpDown.Value = histogramBinsNumericUpDown.Minimum; 151 else if (Content.HistogramBins > histogramBinsNumericUpDown.Maximum) 152 histogramBinsNumericUpDown.Value = histogramBinsNumericUpDown.Maximum; 153 else histogramBinsNumericUpDown.Value = Content.HistogramBins; 154 histogramBinsApproximatelyRadioButton.Checked = !Content.HistogramExactBins; 155 histogramBinsExactRadioButton.Checked = Content.HistogramExactBins; 156 histogramAggregationComboBox.SelectedItem = Content.HistogramAggregation; 141 157 } 142 158 } finally { SuppressEvents = false; } … … 483 499 } 484 500 } 501 502 private void histogramBinsNumericUpDown_ValueChanged(object sender, System.EventArgs e) { 503 if (!SuppressEvents && Content != null) { 504 Content.HistogramBins = (int)histogramBinsNumericUpDown.Value; 505 } 506 } 507 508 private void histogramBinsExactRadioButton_CheckedChanged(object sender, System.EventArgs e) { 509 if (!SuppressEvents && Content != null) { 510 SuppressEvents = true; 511 try { 512 Content.HistogramExactBins = histogramBinsExactRadioButton.Checked; 513 } finally { SuppressEvents = false; } 514 } 515 } 516 517 private void histogramAggregationComboBox_SelectedValueChanged(object sender, System.EventArgs e) { 518 if (!SuppressEvents && Content != null) { 519 SuppressEvents = true; 520 try { 521 Content.HistogramAggregation = (DataTableVisualProperties.DataTableHistogramAggregation)histogramAggregationComboBox.SelectedValue; 522 } finally { SuppressEvents = false; } 523 } 524 } 485 525 #endregion 486 526 -
trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization/DataRowVisualProperties.cs
r14582 r15068 52 52 } 53 53 #endregion 54 #region Histogram Aggregation55 public enum DataRowHistogramAggregation {56 Overlapping,57 SideBySide,58 Stacked59 }60 #endregion61 54 62 55 private DataRowChartType chartType; … … 130 123 } 131 124 } 132 private int bins; 133 public int Bins { 134 get { return bins; } 135 set { 136 if (bins != value) { 137 bins = value; 138 OnPropertyChanged("Bins"); 139 } 140 } 141 } 142 private bool exactBins; 143 public bool ExactBins { 144 get { return exactBins; } 145 set { 146 if (exactBins != value) { 147 exactBins = value; 148 OnPropertyChanged("ExactBins"); 149 } 150 } 151 } 152 private DataRowHistogramAggregation aggregation; 153 public DataRowHistogramAggregation Aggregation { 154 get { return aggregation; } 155 set { 156 if (aggregation != value) { 157 aggregation = value; 158 OnPropertyChanged("Aggregation"); 159 } 160 } 161 } 125 162 126 private double scaleFactor; 163 127 public double ScaleFactor { … … 232 196 set { lineWidth = value; } 233 197 } 234 [Storable(Name = "Bins")]235 private int StorableBins {236 get { return bins; }237 set { bins = value; }238 }239 [Storable(Name = "ExactBins")]240 private bool StorableExactBins {241 get { return exactBins; }242 set { exactBins = value; }243 }244 [Storable(Name = "Aggregation", DefaultValue = DataRowHistogramAggregation.Overlapping)]245 private DataRowHistogramAggregation StorableAggregation {246 get { return aggregation; }247 set { aggregation = value; }248 }249 198 [Storable(Name = "ScaleFactor")] 250 199 private double StorableScaleFactor { … … 262 211 set { displayName = value; } 263 212 } 213 #endregion 214 215 #region Histogram Properties - Backwards Compatability 216 internal enum DataRowHistogramAggregation { 217 Overlapping, 218 SideBySide, 219 Stacked 220 } 221 222 internal int? Bins { get; private set; } 223 internal bool? ExactBins { get; private set; } 224 internal DataRowHistogramAggregation? Aggregation { get; private set; } 225 226 [Storable(Name = "Bins", AllowOneWay = true)] 227 private int StorableBins { set { Bins = value; } } 228 [Storable(Name = "ExactBins", AllowOneWay = true)] 229 private bool StorableExactBins { set { ExactBins = value; } } 230 [Storable(Name = "Aggregation", AllowOneWay = true)] 231 private DataRowHistogramAggregation StorableAggregation { set { Aggregation = value; } } 264 232 #endregion 265 233 … … 275 243 this.startIndexZero = original.startIndexZero; 276 244 this.lineWidth = original.lineWidth; 277 this.bins = original.bins;278 this.exactBins = original.exactBins;279 this.aggregation = original.aggregation;280 245 this.scaleFactor = original.scaleFactor; 281 246 this.displayName = original.displayName; … … 290 255 startIndexZero = false; 291 256 lineWidth = 1; 292 bins = 10;293 exactBins = false;294 aggregation = DataRowHistogramAggregation.Overlapping;295 257 scaleFactor = 1.0; 296 258 displayName = String.Empty; … … 318 280 if (secondXAxis == default(bool) 319 281 && lineStyle == default(DataRowLineStyle) 320 && lineWidth == default(int) && bins == default(int) && exactBins == default(bool)321 282 && displayName == default(string)) { 322 283 secondXAxis = false; 323 284 lineStyle = DataRowLineStyle.Solid; 324 285 lineWidth = 1; 325 bins = 10;326 exactBins = false;327 286 displayName = String.Empty; 328 287 } -
trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization/DataTable.cs
r14185 r15068 112 112 if (VisualProperties == null) VisualProperties = new DataTableVisualProperties(name); 113 113 if (VisualProperties.Title == null) VisualProperties.Title = name; 114 115 #region Backwards Compatability Histogram Visual Properties 116 var rowProperties = Rows.Select(r => r.VisualProperties).ToList(); 117 if (rowProperties.Any(r => r.Bins.HasValue)) 118 VisualProperties.HistogramBins = rowProperties.Where(r => r.Bins.HasValue).Max(r => r.Bins.Value); 119 if (rowProperties.Any(r => r.ExactBins.HasValue)) 120 VisualProperties.HistogramExactBins = rowProperties.Where(r => r.ExactBins.HasValue).Any(r => r.ExactBins.Value); 121 if (rowProperties.Any(r => r.Aggregation.HasValue)) { 122 var maxOccurrence = rowProperties 123 .Where(r => r.Aggregation.HasValue).Select(r => r.Aggregation.Value) 124 .GroupBy(x => x).OrderByDescending(x => x.Count()) 125 .First().Key; 126 VisualProperties.HistogramAggregation = (DataTableVisualProperties.DataTableHistogramAggregation)maxOccurrence; 127 } 128 #endregion 114 129 } 115 130 #endregion -
trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization/DataTableVisualProperties.cs
r14185 r15068 20 20 #endregion 21 21 22 using System; 23 using System.ComponentModel; 24 using System.Drawing; 22 25 using HeuristicLab.Common; 23 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 using System.ComponentModel;25 using System.Drawing;26 27 27 28 namespace HeuristicLab.Analysis { … … 31 32 [StorableClass] 32 33 public class DataTableVisualProperties : DeepCloneable, INotifyPropertyChanged { 34 35 #region Histogram Aggregation 36 public enum DataTableHistogramAggregation { 37 Overlapping, 38 SideBySide, 39 Stacked 40 } 41 #endregion 42 33 43 private Font titleFont; 34 44 public Font TitleFont { … … 352 362 secondYAxisLogScale = value; 353 363 OnPropertyChanged("SecondYAxisLogScale"); 364 } 365 } 366 367 private int histogramBins; 368 public int HistogramBins { 369 get { return histogramBins; } 370 set { 371 if (histogramBins != value) { 372 histogramBins = value; 373 OnPropertyChanged("HistogramBins"); 374 } 375 } 376 } 377 378 private bool histogramExactBins; 379 public bool HistogramExactBins { 380 get { return histogramExactBins; } 381 set { 382 if (histogramExactBins != value) { 383 histogramExactBins = value; 384 OnPropertyChanged("HistogramExactBins"); 385 } 386 } 387 } 388 389 private DataTableHistogramAggregation histogramAggregation; 390 public DataTableHistogramAggregation HistogramAggregation { 391 get { return histogramAggregation; } 392 set { 393 if (histogramAggregation != value) { 394 histogramAggregation = value; 395 OnPropertyChanged("HistogramAggregation"); 396 } 354 397 } 355 398 } … … 500 543 get { return secondYAxisLogScale; } 501 544 set { secondYAxisLogScale = value; } 545 } 546 [Storable(Name = "HistogramBins", DefaultValue = 10)] 547 private int StorableHistogramBins { 548 get { return histogramBins; } 549 set { histogramBins = value; } 550 } 551 [Storable(Name = "HistogramExactBins", DefaultValue = false)] 552 private bool StorableHistogramExactBins { 553 get { return histogramExactBins; } 554 set { histogramExactBins = value; } 555 } 556 [Storable(Name = "HistogramAggregation", DefaultValue = DataTableHistogramAggregation.Overlapping)] 557 private DataTableHistogramAggregation StorableHistogramAggregation { 558 get { return histogramAggregation; } 559 set { histogramAggregation = value; } 502 560 } 503 561 #endregion … … 536 594 this.yAxisLogScale = original.yAxisLogScale; 537 595 this.secondYAxisLogScale = original.secondYAxisLogScale; 596 this.histogramBins = original.histogramBins; 597 this.histogramExactBins = original.histogramExactBins; 598 this.histogramAggregation = original.histogramAggregation; 538 599 } 539 600 public DataTableVisualProperties() { … … 565 626 this.yAxisLogScale = false; 566 627 this.secondYAxisLogScale = false; 628 histogramBins = 10; 629 histogramExactBins = false; 630 histogramAggregation = DataTableHistogramAggregation.Overlapping; 567 631 } 568 632 public DataTableVisualProperties(string title) -
trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingDataTableView.cs
r14381 r15068 716 716 private void AddPointsToHistogramSeries(Series series, DataRow row, List<double> values) { 717 717 if (!row.Values.Any()) return; 718 int bins = row.VisualProperties.Bins;718 int bins = Content.VisualProperties.HistogramBins; 719 719 720 720 double minValue = GetMinimum(row.Values); … … 728 728 729 729 730 if (! row.VisualProperties.ExactBins) {730 if (!Content.VisualProperties.HistogramExactBins) { 731 731 intervalWidth = HumanRoundRange(intervalWidth); 732 732 minValue = Math.Floor(minValue / intervalWidth) * intervalWidth; -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionTreeLengthAnalyzer.cs
r14185 r15068 185 185 186 186 treeLengthsTableRow.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram; 187 treeLengthsTable Row.VisualProperties.ExactBins = false;187 treeLengthsTable.VisualProperties.HistogramExactBins = false; 188 188 189 189 int range = maxLength - minLength; 190 190 if (range == 0) range = 1; 191 191 // the following trick should result in an integer intervalWidth of 1,2,4,... 192 treeLengthsTable Row.VisualProperties.Bins = range;192 treeLengthsTable.VisualProperties.HistogramBins = range; 193 193 194 194 if (maxLength <= 25) // [0,25]
Note: See TracChangeset
for help on using the changeset viewer.