Changeset 5330
- Timestamp:
- 01/19/11 13:19:28 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.Designer.cs
r5287 r5330 68 68 this.tooltip = new System.Windows.Forms.ToolTip(this.components); 69 69 this.colorXAxisButton = new System.Windows.Forms.Button(); 70 this.colorYAxisButton = new System.Windows.Forms.Button(); 70 71 this.noRunsLabel = new System.Windows.Forms.Label(); 71 this. colorYAxisButton = new System.Windows.Forms.Button();72 this.sizeTrackBar = new System.Windows.Forms.TrackBar(); 72 73 ((System.ComponentModel.ISupportInitialize)(this.xTrackBar)).BeginInit(); 73 74 ((System.ComponentModel.ISupportInitialize)(this.yTrackBar)).BeginInit(); 74 75 ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit(); 75 76 this.radioButtonGroup.SuspendLayout(); 77 ((System.ComponentModel.ISupportInitialize)(this.sizeTrackBar)).BeginInit(); 76 78 this.SuspendLayout(); 77 79 // … … 79 81 // 80 82 this.yJitterLabel.AutoSize = true; 81 this.yJitterLabel.Location = new System.Drawing.Point( 350, 6);83 this.yJitterLabel.Location = new System.Drawing.Point(278, 6); 82 84 this.yJitterLabel.Name = "yJitterLabel"; 83 85 this.yJitterLabel.Size = new System.Drawing.Size(32, 13); … … 89 91 this.xJitterlabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 90 92 this.xJitterlabel.AutoSize = true; 91 this.xJitterlabel.Location = new System.Drawing.Point( 635, 316);93 this.xJitterlabel.Location = new System.Drawing.Point(749, 472); 92 94 this.xJitterlabel.Name = "xJitterlabel"; 93 95 this.xJitterlabel.Size = new System.Drawing.Size(32, 13); … … 99 101 this.xTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 100 102 this.xTrackBar.Enabled = false; 101 this.xTrackBar.Location = new System.Drawing.Point( 673, 313);103 this.xTrackBar.Location = new System.Drawing.Point(787, 469); 102 104 this.xTrackBar.Maximum = 100; 103 105 this.xTrackBar.Name = "xTrackBar"; … … 111 113 this.xAxisLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 112 114 this.xAxisLabel.AutoSize = true; 113 this.xAxisLabel.Location = new System.Drawing.Point( 357, 316);115 this.xAxisLabel.Location = new System.Drawing.Point(471, 472); 114 116 this.xAxisLabel.Name = "xAxisLabel"; 115 117 this.xAxisLabel.Size = new System.Drawing.Size(15, 13); … … 123 125 this.xAxisComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 124 126 this.xAxisComboBox.FormattingEnabled = true; 125 this.xAxisComboBox.Location = new System.Drawing.Point( 378, 313);127 this.xAxisComboBox.Location = new System.Drawing.Point(492, 469); 126 128 this.xAxisComboBox.Name = "xAxisComboBox"; 127 129 this.xAxisComboBox.Size = new System.Drawing.Size(221, 21); 128 130 this.xAxisComboBox.TabIndex = 7; 129 this.xAxisComboBox.Selected IndexChanged += new System.EventHandler(this.AxisComboBox_SelectedIndexChanged);131 this.xAxisComboBox.SelectedValueChanged += new System.EventHandler(this.AxisComboBox_SelectedValueChanged); 130 132 // 131 133 // yAxisLabel … … 147 149 this.yAxisComboBox.Size = new System.Drawing.Size(221, 21); 148 150 this.yAxisComboBox.TabIndex = 5; 149 this.yAxisComboBox.Selected IndexChanged += new System.EventHandler(this.AxisComboBox_SelectedIndexChanged);151 this.yAxisComboBox.SelectedValueChanged += new System.EventHandler(this.AxisComboBox_SelectedValueChanged); 150 152 // 151 153 // yTrackBar 152 154 // 153 155 this.yTrackBar.Enabled = false; 154 this.yTrackBar.Location = new System.Drawing.Point(3 88, 3);156 this.yTrackBar.Location = new System.Drawing.Point(312, 3); 155 157 this.yTrackBar.Maximum = 100; 156 158 this.yTrackBar.Name = "yTrackBar"; … … 166 168 this.sizeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 167 169 this.sizeComboBox.FormattingEnabled = true; 168 this.sizeComboBox.Location = new System.Drawing.Point(5 14, 3);170 this.sizeComboBox.Location = new System.Drawing.Point(560, 4); 169 171 this.sizeComboBox.Name = "sizeComboBox"; 170 172 this.sizeComboBox.Size = new System.Drawing.Size(221, 21); 171 173 this.sizeComboBox.TabIndex = 14; 172 this.sizeComboBox.Selected IndexChanged += new System.EventHandler(this.AxisComboBox_SelectedIndexChanged);174 this.sizeComboBox.SelectedValueChanged += new System.EventHandler(this.AxisComboBox_SelectedValueChanged); 173 175 // 174 176 // sizeLabel … … 176 178 this.sizeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 177 179 this.sizeLabel.AutoSize = true; 178 this.sizeLabel.Location = new System.Drawing.Point(4 44, 6);180 this.sizeLabel.Location = new System.Drawing.Point(489, 7); 179 181 this.sizeLabel.Name = "sizeLabel"; 180 182 this.sizeLabel.Size = new System.Drawing.Size(66, 13); … … 192 194 this.chart.Name = "chart"; 193 195 series2.ChartArea = "ChartArea1"; 194 series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Bubble; 195 series2.CustomProperties = "BubbleMinSize=2, BubbleMaxSize=7"; 196 series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; 196 197 series2.IsVisibleInLegend = false; 197 198 series2.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle; … … 199 200 series2.YValuesPerPoint = 2; 200 201 this.chart.Series.Add(series2); 201 this.chart.Size = new System.Drawing.Size( 729, 269);202 this.chart.Size = new System.Drawing.Size(843, 425); 202 203 this.chart.TabIndex = 16; 203 204 this.chart.Text = "chart"; … … 244 245 this.radioButtonGroup.Controls.Add(this.zoomButton); 245 246 this.radioButtonGroup.Controls.Add(this.selectButton); 246 this.radioButtonGroup.Location = new System.Drawing.Point(3, 305);247 this.radioButtonGroup.Location = new System.Drawing.Point(3, 461); 247 248 this.radioButtonGroup.Name = "radioButtonGroup"; 248 249 this.radioButtonGroup.Size = new System.Drawing.Size(135, 32); … … 255 256 this.colorButton.Enabled = false; 256 257 this.colorButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; 257 this.colorButton.Location = new System.Drawing.Point(144, 313);258 this.colorButton.Location = new System.Drawing.Point(144, 469); 258 259 this.colorButton.Name = "colorButton"; 259 260 this.colorButton.Size = new System.Drawing.Size(64, 21); … … 273 274 this.colorXAxisButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 274 275 this.colorXAxisButton.Enabled = false; 275 this.colorXAxisButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.DisplayInColor;276 this.colorXAxisButton.Location = new System.Drawing.Point( 605, 313);276 this.colorXAxisButton.Image = ((System.Drawing.Image)(resources.GetObject("colorXAxisButton.Image"))); 277 this.colorXAxisButton.Location = new System.Drawing.Point(719, 469); 277 278 this.colorXAxisButton.Name = "colorXAxisButton"; 278 279 this.colorXAxisButton.Size = new System.Drawing.Size(21, 21); … … 282 283 this.colorXAxisButton.Click += new System.EventHandler(this.colorXAxisButton_Click); 283 284 // 284 // noRunsLabel285 //286 this.noRunsLabel.Anchor = System.Windows.Forms.AnchorStyles.None;287 this.noRunsLabel.AutoSize = true;288 this.noRunsLabel.Location = new System.Drawing.Point(309, 150);289 this.noRunsLabel.Name = "noRunsLabel";290 this.noRunsLabel.Size = new System.Drawing.Size(138, 13);291 this.noRunsLabel.TabIndex = 21;292 this.noRunsLabel.Text = "No runs could be displayed.";293 //294 285 // colorYAxisButton 295 286 // 296 287 this.colorYAxisButton.Enabled = false; 297 this.colorYAxisButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.DisplayInColor;288 this.colorYAxisButton.Image = ((System.Drawing.Image)(resources.GetObject("colorYAxisButton.Image"))); 298 289 this.colorYAxisButton.Location = new System.Drawing.Point(251, 3); 299 290 this.colorYAxisButton.Name = "colorYAxisButton"; … … 304 295 this.colorYAxisButton.Click += new System.EventHandler(this.colorYAxisButton_Click); 305 296 // 297 // noRunsLabel 298 // 299 this.noRunsLabel.Anchor = System.Windows.Forms.AnchorStyles.None; 300 this.noRunsLabel.AutoSize = true; 301 this.noRunsLabel.Location = new System.Drawing.Point(366, 228); 302 this.noRunsLabel.Name = "noRunsLabel"; 303 this.noRunsLabel.Size = new System.Drawing.Size(138, 13); 304 this.noRunsLabel.TabIndex = 21; 305 this.noRunsLabel.Text = "No runs could be displayed."; 306 // 307 // sizeTrackBar 308 // 309 this.sizeTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 310 this.sizeTrackBar.Location = new System.Drawing.Point(787, 3); 311 this.sizeTrackBar.Maximum = 50; 312 this.sizeTrackBar.Minimum = 5; 313 this.sizeTrackBar.Name = "sizeTrackBar"; 314 this.sizeTrackBar.Size = new System.Drawing.Size(64, 45); 315 this.sizeTrackBar.TabIndex = 24; 316 this.sizeTrackBar.TickStyle = System.Windows.Forms.TickStyle.None; 317 this.sizeTrackBar.Value = 50; 318 this.sizeTrackBar.ValueChanged += new System.EventHandler(this.sizeTrackBar_ValueChanged); 319 // 306 320 // RunCollectionBubbleChartView 307 321 // … … 310 324 this.BackColor = System.Drawing.SystemColors.Window; 311 325 this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 326 this.Controls.Add(this.sizeTrackBar); 312 327 this.Controls.Add(this.colorYAxisButton); 313 328 this.Controls.Add(this.colorXAxisButton); … … 327 342 this.Controls.Add(this.yTrackBar); 328 343 this.Name = "RunCollectionBubbleChartView"; 329 this.Size = new System.Drawing.Size( 740, 340);344 this.Size = new System.Drawing.Size(854, 496); 330 345 ((System.ComponentModel.ISupportInitialize)(this.xTrackBar)).EndInit(); 331 346 ((System.ComponentModel.ISupportInitialize)(this.yTrackBar)).EndInit(); … … 333 348 this.radioButtonGroup.ResumeLayout(false); 334 349 this.radioButtonGroup.PerformLayout(); 350 ((System.ComponentModel.ISupportInitialize)(this.sizeTrackBar)).EndInit(); 335 351 this.ResumeLayout(false); 336 352 this.PerformLayout(); … … 360 376 private System.Windows.Forms.Button colorXAxisButton; 361 377 private System.Windows.Forms.Button colorYAxisButton; 378 private System.Windows.Forms.TrackBar sizeTrackBar; 362 379 } 363 380 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs
r4888 r5330 231 231 this.AddDataPoint(run); 232 232 233 // check to correct max bubble size234 if (this.chart.Series[0].Points.Select(p => p.YValues[1]).Distinct().Count() == 1)235 this.chart.Series[0]["BubbleMaxSize"] = "2";236 else237 this.chart.Series[0]["BubbleMaxSize"] = "7";233 ////check to correct max bubble size 234 //if (this.chart.Series[0].Points.Select(p => p.YValues[1]).Distinct().Count() == 1) 235 // this.chart.Series[0]["BubbleMaxSize"] = "2"; 236 //else 237 // this.chart.Series[0]["BubbleMaxSize"] = "7"; 238 238 239 239 if (this.chart.Series[0].Points.Count == 0) … … 241 241 else { 242 242 noRunsLabel.Visible = false; 243 UpdateMarkerSizes(); 243 244 UpdateCursorInterval(); 244 245 } 245 246 } 246 247 } 248 249 private void UpdateMarkerSizes() { 250 double[] sizeValues = this.chart.Series[0].Points.Select(p => p.YValues[1]).ToArray(); 251 double minSizeValue = sizeValues.Min(); 252 double maxSizeValue = sizeValues.Max(); 253 254 if (maxSizeValue - minSizeValue < double.Epsilon) return; 255 256 for (int i = 0; i < sizeValues.Length; i++) { 257 DataPoint point = this.chart.Series[0].Points[i]; 258 double relativeSize = (point.YValues[1] - minSizeValue) / (maxSizeValue - minSizeValue); 259 point.MarkerSize = (int)Math.Round((sizeTrackBar.Value - sizeTrackBar.Minimum) * relativeSize + sizeTrackBar.Minimum); 260 } 261 262 } 263 247 264 private void AddDataPoint(IRun run) { 248 265 double? xValue; … … 517 534 this.UpdateDataPoints(); 518 535 } 519 520 private void AxisComboBox_SelectedIndexChanged(object sender, EventArgs e) { 536 private void sizeTrackBar_ValueChanged(object sender, EventArgs e) { 537 UpdateMarkerSizes(); 538 } 539 540 private void AxisComboBox_SelectedValueChanged(object sender, EventArgs e) { 521 541 bool axisSelected = xAxisComboBox.SelectedIndex != -1 && yAxisComboBox.SelectedIndex != -1; 522 542 xTrackBar.Enabled = yTrackBar.Enabled = axisSelected;
Note: See TracChangeset
for help on using the changeset viewer.