Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/06/09 14:42:21 (15 years ago)
Author:
gkronber
Message:

Improved layout and rendering of bubble chart. #686 (More compact layout of controls in the CEDMA bubble chart control)

Location:
trunk/sources/HeuristicLab.CEDMA.Charting/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Charting/3.3/BubbleChart.cs

    r2133 r2135  
    111111      Repaint();
    112112      EnforceUpdate();
     113    }
     114
     115    public override void Render(Graphics graphics, int width, int height) {
     116      graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
     117      base.Render(graphics, width, height);
    113118    }
    114119
     
    160165            actualXValues.Add(subEntry.Get(path.ElementAt(1)));
    161166          }
    162         } else {
    163           xs.Add(double.NaN);
    164           actualXValues.Add("NaN");
    165167        }
    166168        if (results.OrdinalVariables.Contains(yDimension)) {
     
    184186            actualYValues.Add(subEntry.Get(path.ElementAt(1)));
    185187          }
    186         } else {
     188        }
     189        if (xs.Count() == 0) {
     190          xs.Add(double.NaN);
     191          actualXValues.Add("NaN");
     192        }
     193        if (ys.Count() == 0) {
    187194          ys.Add(double.NaN);
    188195          actualYValues.Add("NaN");
     
    228235
    229236    private int CalculateAlpha(int size) {
    230       return maxAlpha - (int)((double)(size - minBubbleSize) / (double)(maxBubbleSize - minBubbleSize) * (double)(maxAlpha - minAlpha));
     237      return (minAlpha + maxAlpha) / 2;
    231238    }
    232239
  • trunk/sources/HeuristicLab.CEDMA.Charting/3.3/BubbleChartView.Designer.cs

    r1529 r2135  
    3434      this.sizeComboBox = new System.Windows.Forms.ComboBox();
    3535      this.sizeLabel = new System.Windows.Forms.Label();
    36       this.invertCheckbox = new System.Windows.Forms.CheckBox();
    3736      this.bubbleChartControl = new HeuristicLab.CEDMA.Charting.BubbleChartControl();
    3837      ((System.ComponentModel.ISupportInitialize)(this.xTrackBar)).BeginInit();
     
    4342      //
    4443      this.yJitterLabel.AutoSize = true;
    45       this.yJitterLabel.Location = new System.Drawing.Point(3, 30);
     44      this.yJitterLabel.BackColor = System.Drawing.SystemColors.Control;
     45      this.yJitterLabel.Location = new System.Drawing.Point(151, 6);
    4646      this.yJitterLabel.Name = "yJitterLabel";
    4747      this.yJitterLabel.Size = new System.Drawing.Size(29, 13);
     
    5353      this.xJitterlabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    5454      this.xJitterlabel.AutoSize = true;
    55       this.xJitterlabel.Location = new System.Drawing.Point(291, 418);
     55      this.xJitterlabel.BackColor = System.Drawing.SystemColors.Control;
     56      this.xJitterlabel.Location = new System.Drawing.Point(346, 439);
    5657      this.xJitterlabel.Name = "xJitterlabel";
    5758      this.xJitterlabel.Size = new System.Drawing.Size(29, 13);
     
    6263      //
    6364      this.xTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    64       this.xTrackBar.Location = new System.Drawing.Point(326, 418);
     65      this.xTrackBar.BackColor = System.Drawing.SystemColors.Control;
     66      this.xTrackBar.Location = new System.Drawing.Point(381, 435);
    6567      this.xTrackBar.Maximum = 100;
    6668      this.xTrackBar.Name = "xTrackBar";
    67       this.xTrackBar.Size = new System.Drawing.Size(121, 45);
     69      this.xTrackBar.Size = new System.Drawing.Size(64, 45);
    6870      this.xTrackBar.TabIndex = 11;
    6971      this.xTrackBar.TickStyle = System.Windows.Forms.TickStyle.None;
     
    7476      this.xAxisLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    7577      this.xAxisLabel.AutoSize = true;
    76       this.xAxisLabel.Location = new System.Drawing.Point(305, 394);
     78      this.xAxisLabel.BackColor = System.Drawing.SystemColors.Control;
     79      this.xAxisLabel.Location = new System.Drawing.Point(198, 438);
    7780      this.xAxisLabel.Name = "xAxisLabel";
    7881      this.xAxisLabel.Size = new System.Drawing.Size(15, 13);
     
    8386      //
    8487      this.xAxisComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     88      this.xAxisComboBox.BackColor = System.Drawing.SystemColors.ControlLightLight;
    8589      this.xAxisComboBox.FormattingEnabled = true;
    86       this.xAxisComboBox.Location = new System.Drawing.Point(326, 391);
     90      this.xAxisComboBox.Location = new System.Drawing.Point(219, 435);
    8791      this.xAxisComboBox.Name = "xAxisComboBox";
    8892      this.xAxisComboBox.Size = new System.Drawing.Size(121, 21);
     
    9397      //
    9498      this.yAxisLabel.AutoSize = true;
     99      this.yAxisLabel.BackColor = System.Drawing.SystemColors.Control;
    95100      this.yAxisLabel.Location = new System.Drawing.Point(3, 6);
    96101      this.yAxisLabel.Name = "yAxisLabel";
     
    101106      // yAxisComboBox
    102107      //
     108      this.yAxisComboBox.BackColor = System.Drawing.SystemColors.ControlLightLight;
    103109      this.yAxisComboBox.FormattingEnabled = true;
    104110      this.yAxisComboBox.Location = new System.Drawing.Point(24, 3);
     
    110116      // yTrackBar
    111117      //
    112       this.yTrackBar.Location = new System.Drawing.Point(38, 30);
     118      this.yTrackBar.BackColor = System.Drawing.SystemColors.Control;
     119      this.yTrackBar.Location = new System.Drawing.Point(186, 3);
    113120      this.yTrackBar.Maximum = 100;
    114121      this.yTrackBar.Name = "yTrackBar";
    115       this.yTrackBar.Size = new System.Drawing.Size(107, 45);
     122      this.yTrackBar.Size = new System.Drawing.Size(59, 45);
    116123      this.yTrackBar.TabIndex = 10;
    117124      this.yTrackBar.TickStyle = System.Windows.Forms.TickStyle.None;
     
    121128      //
    122129      this.sizeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     130      this.sizeComboBox.BackColor = System.Drawing.SystemColors.ControlLightLight;
    123131      this.sizeComboBox.FormattingEnabled = true;
    124       this.sizeComboBox.Location = new System.Drawing.Point(329, 3);
     132      this.sizeComboBox.Location = new System.Drawing.Point(324, 3);
    125133      this.sizeComboBox.Name = "sizeComboBox";
    126134      this.sizeComboBox.Size = new System.Drawing.Size(121, 21);
     
    132140      this.sizeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    133141      this.sizeLabel.AutoSize = true;
    134       this.sizeLabel.Location = new System.Drawing.Point(259, 6);
     142      this.sizeLabel.BackColor = System.Drawing.SystemColors.Control;
     143      this.sizeLabel.Location = new System.Drawing.Point(254, 6);
    135144      this.sizeLabel.Name = "sizeLabel";
    136145      this.sizeLabel.Size = new System.Drawing.Size(64, 13);
    137146      this.sizeLabel.TabIndex = 15;
    138147      this.sizeLabel.Text = "Bubble size:";
    139       //
    140       // invertCheckbox
    141       //
    142       this.invertCheckbox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    143       this.invertCheckbox.AutoSize = true;
    144       this.invertCheckbox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
    145       this.invertCheckbox.Location = new System.Drawing.Point(326, 30);
    146       this.invertCheckbox.Name = "invertCheckbox";
    147       this.invertCheckbox.Size = new System.Drawing.Size(64, 17);
    148       this.invertCheckbox.TabIndex = 16;
    149       this.invertCheckbox.Text = "Inverse:";
    150       this.invertCheckbox.UseVisualStyleBackColor = true;
    151       this.invertCheckbox.CheckedChanged += new System.EventHandler(this.sizeComboBox_SelectedIndexChanged);
    152148      //
    153149      // bubbleChartControl
     
    158154      this.bubbleChartControl.BackColor = System.Drawing.SystemColors.Control;
    159155      this.bubbleChartControl.Chart = null;
    160       this.bubbleChartControl.Location = new System.Drawing.Point(3, 81);
     156      this.bubbleChartControl.Location = new System.Drawing.Point(0, 30);
    161157      this.bubbleChartControl.Name = "bubbleChartControl";
    162158      this.bubbleChartControl.ScaleOnResize = true;
    163       this.bubbleChartControl.Size = new System.Drawing.Size(444, 304);
     159      this.bubbleChartControl.Size = new System.Drawing.Size(450, 399);
    164160      this.bubbleChartControl.TabIndex = 17;
    165161      //
     
    168164      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    169165      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    170       this.Controls.Add(this.bubbleChartControl);
    171       this.Controls.Add(this.invertCheckbox);
    172166      this.Controls.Add(this.sizeLabel);
    173167      this.Controls.Add(this.sizeComboBox);
     
    179173      this.Controls.Add(this.yAxisLabel);
    180174      this.Controls.Add(this.yAxisComboBox);
     175      this.Controls.Add(this.bubbleChartControl);
    181176      this.Controls.Add(this.yTrackBar);
    182177      this.Name = "BubbleChartView";
     
    201196    private System.Windows.Forms.ComboBox sizeComboBox;
    202197    private System.Windows.Forms.Label sizeLabel;
    203     private System.Windows.Forms.CheckBox invertCheckbox;
    204198    private BubbleChartControl bubbleChartControl;
    205199  }
  • trunk/sources/HeuristicLab.CEDMA.Charting/3.3/BubbleChartView.cs

    r2131 r2135  
    1313
    1414namespace HeuristicLab.CEDMA.Charting {
    15   public class BubbleChartViewFactory : IResultsViewFactory {
    16     #region IResultsViewFactory Members
    17 
    18     public string Name {
    19       get { return "Bubble chart"; }
    20     }
    21 
    22     public IControl CreateView(Results results) {
    23       return new BubbleChartView(results);
    24     }
    25 
    26     #endregion
    27   }
    28 
    2915  public partial class BubbleChartView : ViewBase {
    3016    private Results Results {
     
    7056
    7157    private void sizeComboBox_SelectedIndexChanged(object sender, EventArgs e) {
    72       bubbleChartControl.Chart.SetBubbleSizeDimension((string)sizeComboBox.SelectedItem, invertCheckbox.Checked);
     58      bubbleChartControl.Chart.SetBubbleSizeDimension((string)sizeComboBox.SelectedItem, false);
    7359      UpdateChart();
    7460    }
    7561  }
     62
     63  public class BubbleChartViewFactory : IResultsViewFactory {
     64    #region IResultsViewFactory Members
     65
     66    public string Name {
     67      get { return "Bubble chart"; }
     68    }
     69
     70    public IControl CreateView(Results results) {
     71      return new BubbleChartView(results);
     72    }
     73
     74    #endregion
     75  }
    7676}
Note: See TracChangeset for help on using the changeset viewer.