Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/27/10 13:33:41 (14 years ago)
Author:
mkommend
Message:

updated RunCollectionBubbleChart (ticket #970)

File:
1 edited

Legend:

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

    r3536 r3543  
    6363      this.isSelecting = false;
    6464
     65     
    6566      this.chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
    6667      this.chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
    67       this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = !this.isSelecting;
    68       this.chart.ChartAreas[0].AxisY.ScaleView.Zoomable = !this.isSelecting;
    6968      this.chart.ChartAreas[0].CursorX.Interval = 0;
    7069      this.chart.ChartAreas[0].CursorY.Interval = 0;
    71 
     70      this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = !this.isSelecting;
     71      this.chart.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;
     72      this.chart.ChartAreas[0].AxisY.ScaleView.Zoomable = !this.isSelecting;
     73      this.chart.ChartAreas[0].AxisY.IntervalAutoMode = IntervalAutoMode.VariableCount;
    7274    }
    7375
     
    179181        foreach (IRun run in this.Content)
    180182          this.AddDataPoint(run);
    181         //Thread.Sleep(100);
     183
     184        //check to correct max bubble size
     185        if (this.chart.Series[0].Points.Select(p => p.YValues[1]).Distinct().Count() == 1)
     186          this.chart.Series[0]["BubbleMaxSize"] = "2";
     187        else
     188          this.chart.Series[0]["BubbleMaxSize"] = "7";
     189
     190        if (this.chart.Series[0].Points.Count == 0)
     191          noRunsLabel.Visible = true;
     192        else
     193          noRunsLabel.Visible = false;
    182194      }
    183195    }
     
    190202      xValue = GetValue(run, (string)xAxisComboBox.SelectedItem);
    191203      yValue = GetValue(run, (string)yAxisComboBox.SelectedItem);
    192       if (xValue.HasValue && yValue.HasValue) {
    193        sizeValue = GetValue(run, (string)sizeComboBox.SelectedItem);
    194         xValue = xValue.Value + xValue.Value * GetXJitter(Content.ElementAt(row)) * xJitterFactor;
    195         yValue = yValue.Value + yValue.Value * GetYJitter(Content.ElementAt(row)) * yJitterFactor;
     204      sizeValue = GetValue(run, (string)sizeComboBox.SelectedItem);
     205      if (xValue.HasValue && yValue.HasValue && sizeValue.HasValue) {
     206        xValue = xValue.Value + xValue.Value * GetXJitter(run) * xJitterFactor;
     207        yValue = yValue.Value + yValue.Value * GetYJitter(run) * yJitterFactor;
    196208        if (run.Visible) {
    197209          DataPoint point = new DataPoint(xValue.Value, new double[] { yValue.Value, sizeValue.Value });
     
    220232        DoubleValue doubleValue = value as DoubleValue;
    221233        IntValue intValue = value as IntValue;
    222         double ret;
    223         if (doubleValue != null)
    224           ret = doubleValue.Value;
    225         else if (intValue != null)
     234        double? ret = null;
     235        if (doubleValue != null) {
     236          if (!double.IsNaN(doubleValue.Value) && !double.IsInfinity(doubleValue.Value))
     237            ret = doubleValue.Value;
     238        } else if (intValue != null)
    226239          ret = intValue.Value;
    227240        else
     
    409422        foreach (var pair in categoricalMapping[dimension]) {
    410423          string labelText = pair.Key.ToString();
    411           if(labelText.Length > 25)
    412             labelText = labelText.Substring(0,25) + " ... ";
     424          if (labelText.Length > 25)
     425            labelText = labelText.Substring(0, 25) + " ... ";
    413426          label = axis.CustomLabels.Add(pair.Value - 0.5, pair.Value + 0.5, labelText);
    414427          label.GridTicks = GridTickTypes.TickMark;
     
    442455    }
    443456    #endregion
    444 
    445     private void sizeLabel_Click(object sender, EventArgs e) {
    446 
    447     }
    448457  }
    449458}
Note: See TracChangeset for help on using the changeset viewer.