Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5348 for trunk


Ignore:
Timestamp:
01/21/11 12:59:21 (14 years ago)
Author:
mkommend
Message:

Added functionality to resize bubbles although the size combobox is set to constant (ticket #1056).

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

    r5336 r5348  
    315315      this.sizeTrackBar.TabIndex = 24;
    316316      this.sizeTrackBar.TickStyle = System.Windows.Forms.TickStyle.None;
    317       this.sizeTrackBar.Value = 50;
     317      this.sizeTrackBar.Value = 15;
    318318      this.sizeTrackBar.ValueChanged += new System.EventHandler(this.sizeTrackBar_ValueChanged);
    319319      //
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs

    r5330 r5348  
    231231          this.AddDataPoint(run);
    232232
    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 
    239233        if (this.chart.Series[0].Points.Count == 0)
    240234          noRunsLabel.Visible = true;
     
    252246      double maxSizeValue = sizeValues.Max();
    253247
    254       if (maxSizeValue - minSizeValue < double.Epsilon) return;
    255 
    256248      for (int i = 0; i < sizeValues.Length; i++) {
    257249        DataPoint point = this.chart.Series[0].Points[i];
    258         double relativeSize = (point.YValues[1] - minSizeValue) / (maxSizeValue - minSizeValue);
     250        double sizeRange = maxSizeValue - minSizeValue;
     251        double relativeSize = (point.YValues[1] - minSizeValue);
     252
     253        if (sizeRange > double.Epsilon) relativeSize /= sizeRange;
     254        else relativeSize = 1;
     255
    259256        point.MarkerSize = (int)Math.Round((sizeTrackBar.Value - sizeTrackBar.Minimum) * relativeSize + sizeTrackBar.Minimum);
    260257      }
    261 
    262258    }
    263259
Note: See TracChangeset for help on using the changeset viewer.