Changeset 3543


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

updated RunCollectionBubbleChart (ticket #970)

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

    r3524 r3543  
    4444      this.colorDialog = new System.Windows.Forms.ColorDialog();
    4545      this.tooltip = new System.Windows.Forms.ToolTip(this.components);
     46      this.noRunsLabel = new System.Windows.Forms.Label();
    4647      ((System.ComponentModel.ISupportInitialize)(this.xTrackBar)).BeginInit();
    4748      ((System.ComponentModel.ISupportInitialize)(this.yTrackBar)).BeginInit();
     
    6364      this.xJitterlabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    6465      this.xJitterlabel.AutoSize = true;
    65       this.xJitterlabel.Location = new System.Drawing.Point(569, 308);
     66      this.xJitterlabel.Location = new System.Drawing.Point(539, 295);
    6667      this.xJitterlabel.Name = "xJitterlabel";
    6768      this.xJitterlabel.Size = new System.Drawing.Size(32, 13);
     
    7273      //
    7374      this.xTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    74       this.xTrackBar.Location = new System.Drawing.Point(607, 305);
     75      this.xTrackBar.Location = new System.Drawing.Point(577, 292);
    7576      this.xTrackBar.Maximum = 100;
    7677      this.xTrackBar.Name = "xTrackBar";
     
    8485      this.xAxisLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    8586      this.xAxisLabel.AutoSize = true;
    86       this.xAxisLabel.Location = new System.Drawing.Point(320, 307);
     87      this.xAxisLabel.Location = new System.Drawing.Point(290, 294);
    8788      this.xAxisLabel.Name = "xAxisLabel";
    8889      this.xAxisLabel.Size = new System.Drawing.Size(15, 13);
     
    9697      this.xAxisComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    9798      this.xAxisComboBox.FormattingEnabled = true;
    98       this.xAxisComboBox.Location = new System.Drawing.Point(341, 305);
     99      this.xAxisComboBox.Location = new System.Drawing.Point(311, 292);
    99100      this.xAxisComboBox.Name = "xAxisComboBox";
    100101      this.xAxisComboBox.Size = new System.Drawing.Size(221, 21);
     
    138139      this.sizeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    139140      this.sizeComboBox.FormattingEnabled = true;
    140       this.sizeComboBox.Location = new System.Drawing.Point(448, 3);
     141      this.sizeComboBox.Location = new System.Drawing.Point(418, 3);
    141142      this.sizeComboBox.Name = "sizeComboBox";
    142143      this.sizeComboBox.Size = new System.Drawing.Size(221, 21);
     
    148149      this.sizeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    149150      this.sizeLabel.AutoSize = true;
    150       this.sizeLabel.Location = new System.Drawing.Point(378, 6);
     151      this.sizeLabel.Location = new System.Drawing.Point(348, 6);
    151152      this.sizeLabel.Name = "sizeLabel";
    152153      this.sizeLabel.Size = new System.Drawing.Size(66, 13);
    153154      this.sizeLabel.TabIndex = 15;
    154155      this.sizeLabel.Text = "Bubble Size:";
    155       this.sizeLabel.Click += new System.EventHandler(this.sizeLabel_Click);
    156156      //
    157157      // chart
     
    172172      series1.YValuesPerPoint = 2;
    173173      this.chart.Series.Add(series1);
    174       this.chart.Size = new System.Drawing.Size(663, 261);
     174      this.chart.Size = new System.Drawing.Size(633, 248);
    175175      this.chart.TabIndex = 16;
    176176      this.chart.Text = "chart";
     
    209209      this.radioButtonGroup.Controls.Add(this.zoomButton);
    210210      this.radioButtonGroup.Controls.Add(this.selectButton);
    211       this.radioButtonGroup.Location = new System.Drawing.Point(3, 297);
     211      this.radioButtonGroup.Location = new System.Drawing.Point(3, 284);
    212212      this.radioButtonGroup.Name = "radioButtonGroup";
    213213      this.radioButtonGroup.Size = new System.Drawing.Size(135, 32);
     
    220220      this.colorButton.Enabled = false;
    221221      this.colorButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
    222       this.colorButton.Location = new System.Drawing.Point(144, 305);
     222      this.colorButton.Location = new System.Drawing.Point(144, 292);
    223223      this.colorButton.Name = "colorButton";
    224224      this.colorButton.Size = new System.Drawing.Size(64, 21);
     
    233233      this.colorDialog.FullOpen = true;
    234234      //
     235      // noRunsLabel
     236      //
     237      this.noRunsLabel.Anchor = System.Windows.Forms.AnchorStyles.None;
     238      this.noRunsLabel.AutoSize = true;
     239      this.noRunsLabel.Location = new System.Drawing.Point(261, 139);
     240      this.noRunsLabel.Name = "noRunsLabel";
     241      this.noRunsLabel.Size = new System.Drawing.Size(138, 13);
     242      this.noRunsLabel.TabIndex = 21;
     243      this.noRunsLabel.Text = "No runs could be displayed.";
     244      //
    235245      // RunCollectionBubbleChartView
    236246      //
     
    239249      this.BackColor = System.Drawing.SystemColors.Window;
    240250      this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     251      this.Controls.Add(this.noRunsLabel);
    241252      this.Controls.Add(this.colorButton);
    242253      this.Controls.Add(this.radioButtonGroup);
     
    253264      this.Controls.Add(this.yTrackBar);
    254265      this.Name = "RunCollectionBubbleChartView";
    255       this.Size = new System.Drawing.Size(674, 332);
     266      this.Size = new System.Drawing.Size(644, 319);
    256267      ((System.ComponentModel.ISupportInitialize)(this.xTrackBar)).EndInit();
    257268      ((System.ComponentModel.ISupportInitialize)(this.yTrackBar)).EndInit();
     
    283294    private System.Windows.Forms.ColorDialog colorDialog;
    284295    private System.Windows.Forms.ToolTip tooltip;
     296    private System.Windows.Forms.Label noRunsLabel;
    285297  }
    286298}
  • 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.