Changeset 9229
- Timestamp:
- 02/19/13 12:36:17 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.Designer.cs
r9190 r9229 318 318 this.sizeTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 319 319 this.sizeTrackBar.Location = new System.Drawing.Point(787, 3); 320 this.sizeTrackBar.Maximum = 50;321 this.sizeTrackBar.Minimum = 5;320 this.sizeTrackBar.Maximum = 20; 321 this.sizeTrackBar.Minimum = -20; 322 322 this.sizeTrackBar.Name = "sizeTrackBar"; 323 323 this.sizeTrackBar.Size = new System.Drawing.Size(64, 45); 324 324 this.sizeTrackBar.TabIndex = 24; 325 this.sizeTrackBar.Tick Style = System.Windows.Forms.TickStyle.None;326 this.sizeTrackBar. Value = 10;325 this.sizeTrackBar.TickFrequency = 25; 326 this.sizeTrackBar.TickStyle = System.Windows.Forms.TickStyle.TopLeft; 327 327 this.sizeTrackBar.ValueChanged += new System.EventHandler(this.sizeTrackBar_ValueChanged); 328 328 // 329 // ToolStripMenuItem329 // getDataAsMatrixToolStripMenuItem 330 330 // 331 331 this.getDataAsMatrixToolStripMenuItem.Name = "getDataAsMatrixToolStripMenuItem"; … … 336 336 // RunCollectionBubbleChartView 337 337 // 338 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);339 338 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 340 339 this.BackColor = System.Drawing.SystemColors.Window; -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs
r9190 r9229 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 using HeuristicLab.Core;24 using HeuristicLab.Data;25 using HeuristicLab.MainForm;26 using HeuristicLab.MainForm.WindowsForms;27 22 using System; 28 23 using System.Collections.Generic; … … 31 26 using System.Windows.Forms; 32 27 using System.Windows.Forms.DataVisualization.Charting; 28 using HeuristicLab.Common; 29 using HeuristicLab.Core; 30 using HeuristicLab.Data; 31 using HeuristicLab.MainForm; 32 using HeuristicLab.MainForm.WindowsForms; 33 33 34 34 namespace HeuristicLab.Optimization.Views { … … 272 272 273 273 private void UpdateMarkerSizes() { 274 double[] sizeValues = this.chart.Series[0].Points.Select(p => p.YValues[1]).ToArray(); 274 var series = chart.Series[0]; 275 var sizeValues = series.Points.Select(p => p.YValues[1]); 276 275 277 double minSizeValue = sizeValues.Min(); 276 278 double maxSizeValue = sizeValues.Max(); 277 278 for (int i = 0; i < sizeValues.Length; i++) { 279 DataPoint point = this.chart.Series[0].Points[i]; 280 double sizeRange = maxSizeValue - minSizeValue; 279 double sizeRange = maxSizeValue - minSizeValue; 280 281 const int smallestBubbleSize = 5; 282 283 foreach (DataPoint point in series.Points) { 284 //calculates the relative size of the data point 0 <= relativeSize <= 1 281 285 double relativeSize = (point.YValues[1] - minSizeValue); 282 283 if (sizeRange > double.Epsilon) relativeSize /= sizeRange; 284 else relativeSize = 1; 285 286 point.MarkerSize = (int)Math.Round((sizeTrackBar.Value - sizeTrackBar.Minimum) * relativeSize + sizeTrackBar.Minimum); 286 if (sizeRange > double.Epsilon) { 287 relativeSize /= sizeRange; 288 289 //invert bubble sizes if the value of the trackbar is negative 290 if (sizeTrackBar.Value < 0) relativeSize = Math.Abs(relativeSize - 1); 291 } else relativeSize = 1; 292 293 double sizeChange = Math.Abs(sizeTrackBar.Value) * relativeSize; 294 point.MarkerSize = (int)Math.Round(sizeChange + smallestBubbleSize); 287 295 } 288 296 }
Note: See TracChangeset
for help on using the changeset viewer.