Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/17/17 13:22:51 (8 years ago)
Author:
pfleck
Message:

#2709

  • Added Legend order when grouping for histogram and (single and multi)scatterplot.
  • Removed the limitation of distinct values for the singlescatterplot (for the color gradient).
  • Added a legend-visible checkbox for the multi-scatterplot.
Location:
branches/DataPreprocessing Enhancements
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.Designer.cs

    r14583 r14993  
    4545    /// </summary>
    4646    private void InitializeComponent() {
     47      this.components = new System.ComponentModel.Container();
    4748      this.optionsBox = new System.Windows.Forms.GroupBox();
    48       this.label2 = new System.Windows.Forms.Label();
    49       this.label1 = new System.Windows.Forms.Label();
     49      this.groupingTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
     50      this.variableLabel = new System.Windows.Forms.Label();
     51      this.orderLabel = new System.Windows.Forms.Label();
     52      this.aggregationLabel = new System.Windows.Forms.Label();
     53      this.orderComboBox = new System.Windows.Forms.ComboBox();
     54      this.classifierComboBox = new System.Windows.Forms.ComboBox();
    5055      this.aggregationComboBox = new System.Windows.Forms.ComboBox();
    51       this.classifierComboBox = new System.Windows.Forms.ComboBox();
     56      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    5257      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
    5358      this.splitContainer.Panel1.SuspendLayout();
    5459      this.splitContainer.SuspendLayout();
    5560      this.optionsBox.SuspendLayout();
     61      this.groupingTableLayoutPanel.SuspendLayout();
    5662      this.SuspendLayout();
    5763      //
     64      // sizeGroupBox
     65      //
     66      this.sizeGroupBox.Location = new System.Drawing.Point(0, 258);
     67      //
    5868      // splitContainer
    5969      //
     
    6575      // optionsBox
    6676      //
    67       this.optionsBox.Controls.Add(this.label2);
    68       this.optionsBox.Controls.Add(this.label1);
    69       this.optionsBox.Controls.Add(this.aggregationComboBox);
    70       this.optionsBox.Controls.Add(this.classifierComboBox);
     77      this.optionsBox.Controls.Add(this.groupingTableLayoutPanel);
    7178      this.optionsBox.Dock = System.Windows.Forms.DockStyle.Bottom;
    72       this.optionsBox.Location = new System.Drawing.Point(0, 292);
     79      this.optionsBox.Location = new System.Drawing.Point(0, 302);
    7380      this.optionsBox.Name = "optionsBox";
    74       this.optionsBox.Size = new System.Drawing.Size(180, 111);
     81      this.optionsBox.Size = new System.Drawing.Size(180, 101);
    7582      this.optionsBox.TabIndex = 7;
    7683      this.optionsBox.TabStop = false;
    7784      this.optionsBox.Text = "Grouping Options";
    7885      //
    79       // label2
    80       //
    81       this.label2.AutoSize = true;
    82       this.label2.Location = new System.Drawing.Point(2, 61);
    83       this.label2.Name = "label2";
    84       this.label2.Size = new System.Drawing.Size(67, 13);
    85       this.label2.TabIndex = 2;
    86       this.label2.Text = "Aggregation:";
    87       //
    88       // label1
    89       //
    90       this.label1.AutoSize = true;
    91       this.label1.Location = new System.Drawing.Point(3, 15);
    92       this.label1.Name = "label1";
    93       this.label1.Size = new System.Drawing.Size(48, 13);
    94       this.label1.TabIndex = 2;
    95       this.label1.Text = "Variable:";
     86      // groupingTableLayoutPanel
     87      //
     88      this.groupingTableLayoutPanel.ColumnCount = 2;
     89      this.groupingTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
     90      this.groupingTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
     91      this.groupingTableLayoutPanel.Controls.Add(this.variableLabel, 0, 0);
     92      this.groupingTableLayoutPanel.Controls.Add(this.orderLabel, 0, 2);
     93      this.groupingTableLayoutPanel.Controls.Add(this.aggregationLabel, 0, 1);
     94      this.groupingTableLayoutPanel.Controls.Add(this.orderComboBox, 1, 2);
     95      this.groupingTableLayoutPanel.Controls.Add(this.classifierComboBox, 1, 0);
     96      this.groupingTableLayoutPanel.Controls.Add(this.aggregationComboBox, 1, 1);
     97      this.groupingTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
     98      this.groupingTableLayoutPanel.Location = new System.Drawing.Point(3, 16);
     99      this.groupingTableLayoutPanel.Name = "groupingTableLayoutPanel";
     100      this.groupingTableLayoutPanel.RowCount = 3;
     101      this.groupingTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
     102      this.groupingTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
     103      this.groupingTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
     104      this.groupingTableLayoutPanel.Size = new System.Drawing.Size(174, 82);
     105      this.groupingTableLayoutPanel.TabIndex = 3;
     106      //
     107      // variableLabel
     108      //
     109      this.variableLabel.AutoSize = true;
     110      this.variableLabel.Dock = System.Windows.Forms.DockStyle.Fill;
     111      this.variableLabel.Location = new System.Drawing.Point(3, 0);
     112      this.variableLabel.Name = "variableLabel";
     113      this.variableLabel.Size = new System.Drawing.Size(48, 27);
     114      this.variableLabel.TabIndex = 2;
     115      this.variableLabel.Text = "Variable:";
     116      this.variableLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     117      //
     118      // orderLabel
     119      //
     120      this.orderLabel.AutoSize = true;
     121      this.orderLabel.Dock = System.Windows.Forms.DockStyle.Fill;
     122      this.orderLabel.Location = new System.Drawing.Point(3, 54);
     123      this.orderLabel.Name = "orderLabel";
     124      this.orderLabel.Size = new System.Drawing.Size(48, 28);
     125      this.orderLabel.TabIndex = 2;
     126      this.orderLabel.Text = "Order:";
     127      this.orderLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     128      this.toolTip.SetToolTip(this.orderLabel, "Order of Legend Entries");
     129      //
     130      // aggregationLabel
     131      //
     132      this.aggregationLabel.AutoSize = true;
     133      this.aggregationLabel.Dock = System.Windows.Forms.DockStyle.Fill;
     134      this.aggregationLabel.Location = new System.Drawing.Point(3, 27);
     135      this.aggregationLabel.Name = "aggregationLabel";
     136      this.aggregationLabel.Size = new System.Drawing.Size(48, 27);
     137      this.aggregationLabel.TabIndex = 2;
     138      this.aggregationLabel.Text = "Aggr.:";
     139      this.aggregationLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     140      this.toolTip.SetToolTip(this.aggregationLabel, "Aggregation");
     141      //
     142      // orderComboBox
     143      //
     144      this.orderComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
     145      this.orderComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     146      this.orderComboBox.FormattingEnabled = true;
     147      this.orderComboBox.Location = new System.Drawing.Point(57, 57);
     148      this.orderComboBox.Name = "orderComboBox";
     149      this.orderComboBox.Size = new System.Drawing.Size(114, 21);
     150      this.orderComboBox.TabIndex = 1;
     151      this.orderComboBox.SelectedIndexChanged += new System.EventHandler(this.orderComboBox_SelectedIndexChanged);
     152      //
     153      // classifierComboBox
     154      //
     155      this.classifierComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
     156      this.classifierComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     157      this.classifierComboBox.FormattingEnabled = true;
     158      this.classifierComboBox.Location = new System.Drawing.Point(57, 3);
     159      this.classifierComboBox.Name = "classifierComboBox";
     160      this.classifierComboBox.Size = new System.Drawing.Size(114, 21);
     161      this.classifierComboBox.TabIndex = 1;
     162      this.classifierComboBox.SelectedIndexChanged += new System.EventHandler(this.classifierComboBox_SelectedIndexChanged);
    96163      //
    97164      // aggregationComboBox
    98165      //
    99       this.aggregationComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    100             | System.Windows.Forms.AnchorStyles.Right)));
     166      this.aggregationComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
    101167      this.aggregationComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    102168      this.aggregationComboBox.FormattingEnabled = true;
    103       this.aggregationComboBox.Location = new System.Drawing.Point(5, 79);
     169      this.aggregationComboBox.Location = new System.Drawing.Point(57, 30);
    104170      this.aggregationComboBox.Name = "aggregationComboBox";
    105       this.aggregationComboBox.Size = new System.Drawing.Size(169, 21);
     171      this.aggregationComboBox.Size = new System.Drawing.Size(114, 21);
    106172      this.aggregationComboBox.TabIndex = 1;
    107173      this.aggregationComboBox.SelectedIndexChanged += new System.EventHandler(this.aggregationComboBox_SelectedIndexChanged);
    108       //
    109       // classifierComboBox
    110       //
    111       this.classifierComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    112             | System.Windows.Forms.AnchorStyles.Right)));
    113       this.classifierComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    114       this.classifierComboBox.FormattingEnabled = true;
    115       this.classifierComboBox.Location = new System.Drawing.Point(5, 33);
    116       this.classifierComboBox.Name = "classifierComboBox";
    117       this.classifierComboBox.Size = new System.Drawing.Size(169, 21);
    118       this.classifierComboBox.TabIndex = 1;
    119       this.classifierComboBox.SelectedIndexChanged += new System.EventHandler(this.classifierComboBox_SelectedIndexChanged);
    120174      //
    121175      // HistogramView
     
    129183      this.splitContainer.ResumeLayout(false);
    130184      this.optionsBox.ResumeLayout(false);
    131       this.optionsBox.PerformLayout();
     185      this.groupingTableLayoutPanel.ResumeLayout(false);
     186      this.groupingTableLayoutPanel.PerformLayout();
    132187      this.ResumeLayout(false);
    133188
     
    138193    private System.Windows.Forms.GroupBox optionsBox;
    139194    private System.Windows.Forms.ComboBox classifierComboBox;
    140     private System.Windows.Forms.Label label1;
    141     private System.Windows.Forms.Label label2;
     195    private System.Windows.Forms.Label variableLabel;
     196    private System.Windows.Forms.Label aggregationLabel;
    142197    private System.Windows.Forms.ComboBox aggregationComboBox;
     198    private System.Windows.Forms.TableLayoutPanel groupingTableLayoutPanel;
     199    private System.Windows.Forms.Label orderLabel;
     200    private System.Windows.Forms.ComboBox orderComboBox;
     201    private System.Windows.Forms.ToolTip toolTip;
    143202  }
    144203}
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.cs

    r14725 r14993  
    2828  [Content(typeof(HistogramContent), true)]
    2929  public partial class HistogramView : PreprocessingChartView {
     30
    3031    public new HistogramContent Content {
    3132      get { return (HistogramContent)base.Content; }
     
    3738      aggregationComboBox.DataSource = Enum.GetValues(typeof(DataRowVisualProperties.DataRowHistogramAggregation));
    3839      aggregationComboBox.SelectedItem = DataRowVisualProperties.DataRowHistogramAggregation.Overlapping;
     40      orderComboBox.DataSource = Enum.GetValues(typeof(PreprocessingChartContent.LegendOrder));
     41      orderComboBox.SelectedItem = PreprocessingChartContent.LegendOrder.Appearance;
    3942    }
    4043
     
    5558    protected override DataTable CreateDataTable(string variableName) {
    5659      var aggregation = (DataRowVisualProperties.DataRowHistogramAggregation)aggregationComboBox.SelectedItem;
    57       return HistogramContent.CreateHistogram(Content.PreprocessingData, variableName, Content.GroupingVariableName, aggregation);
     60      return HistogramContent.CreateHistogram(Content.PreprocessingData, variableName, Content.GroupingVariableName, aggregation, Content.Order);
    5861    }
    5962
     
    7376      }
    7477    }
     78
     79    private void orderComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     80      Content.Order = (PreprocessingChartContent.LegendOrder)orderComboBox.SelectedItem;
     81
     82      // rebuild datatables
     83      InitData();
     84      GenerateLayout();
     85    }
    7586  }
    7687}
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.Designer.cs

    r14975 r14993  
    6464      this.polynomialRegressionOrderNumericUpDown = new System.Windows.Forms.NumericUpDown();
    6565      this.orderLabel = new System.Windows.Forms.Label();
    66       this.label4 = new System.Windows.Forms.Label();
     66      this.regressionTyleLabel = new System.Windows.Forms.Label();
    6767      this.groupingOptionsBox = new System.Windows.Forms.GroupBox();
     68      this.legendGroupBox = new System.Windows.Forms.GroupBox();
     69      this.legendCheckbox = new System.Windows.Forms.CheckBox();
     70      this.legendOrderComboBox = new System.Windows.Forms.ComboBox();
     71      this.legendOrderLabel = new System.Windows.Forms.Label();
    6872      this.aggregationLabel = new System.Windows.Forms.Label();
    6973      this.aggregationComboBox = new System.Windows.Forms.ComboBox();
    7074      this.groupingComboBox = new System.Windows.Forms.ComboBox();
    71       this.label1 = new System.Windows.Forms.Label();
     75      this.opacityLabel = new System.Windows.Forms.Label();
    7276      this.pointOpacityNumericUpDown = new System.Windows.Forms.NumericUpDown();
    7377      this.pointsGroupBox = new System.Windows.Forms.GroupBox();
     
    8791      ((System.ComponentModel.ISupportInitialize)(this.polynomialRegressionOrderNumericUpDown)).BeginInit();
    8892      this.groupingOptionsBox.SuspendLayout();
     93      this.legendGroupBox.SuspendLayout();
    8994      ((System.ComponentModel.ISupportInitialize)(this.pointOpacityNumericUpDown)).BeginInit();
    9095      this.pointsGroupBox.SuspendLayout();
     
    212217      this.sizeGroupBox.Controls.Add(this.lockAspectCheckBox);
    213218      this.sizeGroupBox.Dock = System.Windows.Forms.DockStyle.Bottom;
    214       this.sizeGroupBox.Location = new System.Drawing.Point(0, 78);
     219      this.sizeGroupBox.Location = new System.Drawing.Point(0, 30);
    215220      this.sizeGroupBox.Name = "sizeGroupBox";
    216221      this.sizeGroupBox.Size = new System.Drawing.Size(180, 94);
     
    338343      this.regressionGroupBox.Controls.Add(this.polynomialRegressionOrderNumericUpDown);
    339344      this.regressionGroupBox.Controls.Add(this.orderLabel);
    340       this.regressionGroupBox.Controls.Add(this.label4);
     345      this.regressionGroupBox.Controls.Add(this.regressionTyleLabel);
    341346      this.regressionGroupBox.Dock = System.Windows.Forms.DockStyle.Bottom;
    342347      this.regressionGroupBox.Location = new System.Drawing.Point(0, 322);
     
    394399      this.orderLabel.Text = "Order:";
    395400      //
    396       // label4
    397       //
    398       this.label4.AutoSize = true;
    399       this.label4.Location = new System.Drawing.Point(6, 22);
    400       this.label4.Name = "label4";
    401       this.label4.Size = new System.Drawing.Size(34, 13);
    402       this.label4.TabIndex = 13;
    403       this.label4.Text = "Type:";
     401      // regressionTyleLabel
     402      //
     403      this.regressionTyleLabel.AutoSize = true;
     404      this.regressionTyleLabel.Location = new System.Drawing.Point(6, 22);
     405      this.regressionTyleLabel.Name = "regressionTyleLabel";
     406      this.regressionTyleLabel.Size = new System.Drawing.Size(34, 13);
     407      this.regressionTyleLabel.TabIndex = 13;
     408      this.regressionTyleLabel.Text = "Type:";
    404409      //
    405410      // groupingOptionsBox
    406411      //
     412      this.groupingOptionsBox.Controls.Add(this.legendGroupBox);
    407413      this.groupingOptionsBox.Controls.Add(this.aggregationLabel);
    408414      this.groupingOptionsBox.Controls.Add(this.aggregationComboBox);
    409415      this.groupingOptionsBox.Controls.Add(this.groupingComboBox);
    410416      this.groupingOptionsBox.Dock = System.Windows.Forms.DockStyle.Bottom;
    411       this.groupingOptionsBox.Location = new System.Drawing.Point(0, 241);
     417      this.groupingOptionsBox.Location = new System.Drawing.Point(0, 193);
    412418      this.groupingOptionsBox.Name = "groupingOptionsBox";
    413       this.groupingOptionsBox.Size = new System.Drawing.Size(180, 81);
     419      this.groupingOptionsBox.Size = new System.Drawing.Size(180, 129);
    414420      this.groupingOptionsBox.TabIndex = 8;
    415421      this.groupingOptionsBox.TabStop = false;
    416422      this.groupingOptionsBox.Text = "Grouping";
    417423      //
     424      // legendGroupBox
     425      //
     426      this.legendGroupBox.Controls.Add(this.legendCheckbox);
     427      this.legendGroupBox.Controls.Add(this.legendOrderComboBox);
     428      this.legendGroupBox.Controls.Add(this.legendOrderLabel);
     429      this.legendGroupBox.Enabled = false;
     430      this.legendGroupBox.Location = new System.Drawing.Point(9, 73);
     431      this.legendGroupBox.Name = "legendGroupBox";
     432      this.legendGroupBox.Size = new System.Drawing.Size(164, 50);
     433      this.legendGroupBox.TabIndex = 7;
     434      this.legendGroupBox.TabStop = false;
     435      this.legendGroupBox.Text = "Legend";
     436      //
     437      // legendCheckbox
     438      //
     439      this.legendCheckbox.AutoSize = true;
     440      this.legendCheckbox.Checked = true;
     441      this.legendCheckbox.CheckState = System.Windows.Forms.CheckState.Checked;
     442      this.legendCheckbox.Location = new System.Drawing.Point(56, -1);
     443      this.legendCheckbox.Name = "legendCheckbox";
     444      this.legendCheckbox.Size = new System.Drawing.Size(56, 17);
     445      this.legendCheckbox.TabIndex = 0;
     446      this.legendCheckbox.Text = "Visible";
     447      this.legendCheckbox.UseVisualStyleBackColor = true;
     448      this.legendCheckbox.CheckedChanged += new System.EventHandler(this.legendCheckbox_CheckedChanged);
     449      //
     450      // legendOrderComboBox
     451      //
     452      this.legendOrderComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     453      this.legendOrderComboBox.FormattingEnabled = true;
     454      this.legendOrderComboBox.Location = new System.Drawing.Point(49, 19);
     455      this.legendOrderComboBox.Name = "legendOrderComboBox";
     456      this.legendOrderComboBox.Size = new System.Drawing.Size(109, 21);
     457      this.legendOrderComboBox.TabIndex = 5;
     458      this.legendOrderComboBox.SelectedIndexChanged += new System.EventHandler(this.legendOrderComboBox_SelectedIndexChanged);
     459      //
     460      // legendOrderLabel
     461      //
     462      this.legendOrderLabel.AutoSize = true;
     463      this.legendOrderLabel.Location = new System.Drawing.Point(7, 22);
     464      this.legendOrderLabel.Name = "legendOrderLabel";
     465      this.legendOrderLabel.Size = new System.Drawing.Size(36, 13);
     466      this.legendOrderLabel.TabIndex = 4;
     467      this.legendOrderLabel.Text = "Order:";
     468      this.legendOrderLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     469      //
    418470      // aggregationLabel
    419471      //
    420472      this.aggregationLabel.AutoSize = true;
    421       this.aggregationLabel.Location = new System.Drawing.Point(6, 49);
     473      this.aggregationLabel.Enabled = false;
     474      this.aggregationLabel.Location = new System.Drawing.Point(5, 49);
    422475      this.aggregationLabel.Name = "aggregationLabel";
    423476      this.aggregationLabel.Size = new System.Drawing.Size(67, 13);
     
    450503      this.groupingComboBox.SelectedIndexChanged += new System.EventHandler(this.groupingComboBox_SelectedIndexChanged);
    451504      //
    452       // label1
    453       //
    454       this.label1.AutoSize = true;
    455       this.label1.Location = new System.Drawing.Point(6, 43);
    456       this.label1.Name = "label1";
    457       this.label1.Size = new System.Drawing.Size(46, 13);
    458       this.label1.TabIndex = 7;
    459       this.label1.Text = "Opacity:";
     505      // opacityLabel
     506      //
     507      this.opacityLabel.AutoSize = true;
     508      this.opacityLabel.Location = new System.Drawing.Point(6, 43);
     509      this.opacityLabel.Name = "opacityLabel";
     510      this.opacityLabel.Size = new System.Drawing.Size(46, 13);
     511      this.opacityLabel.TabIndex = 7;
     512      this.opacityLabel.Text = "Opacity:";
    460513      //
    461514      // pointOpacityNumericUpDown
     
    490543      this.pointsGroupBox.Controls.Add(this.pointSizeLabel);
    491544      this.pointsGroupBox.Controls.Add(this.pointSizeNumericUpDown);
    492       this.pointsGroupBox.Controls.Add(this.label1);
     545      this.pointsGroupBox.Controls.Add(this.opacityLabel);
    493546      this.pointsGroupBox.Dock = System.Windows.Forms.DockStyle.Bottom;
    494       this.pointsGroupBox.Location = new System.Drawing.Point(0, 172);
     547      this.pointsGroupBox.Location = new System.Drawing.Point(0, 124);
    495548      this.pointsGroupBox.Name = "pointsGroupBox";
    496549      this.pointsGroupBox.Size = new System.Drawing.Size(180, 69);
     
    525578      this.groupingOptionsBox.ResumeLayout(false);
    526579      this.groupingOptionsBox.PerformLayout();
     580      this.legendGroupBox.ResumeLayout(false);
     581      this.legendGroupBox.PerformLayout();
    527582      ((System.ComponentModel.ISupportInitialize)(this.pointOpacityNumericUpDown)).EndInit();
    528583      this.pointsGroupBox.ResumeLayout(false);
     
    548603    private System.Windows.Forms.NumericUpDown polynomialRegressionOrderNumericUpDown;
    549604    private System.Windows.Forms.Label orderLabel;
    550     private System.Windows.Forms.Label label4;
     605    private System.Windows.Forms.Label regressionTyleLabel;
    551606    private System.Windows.Forms.GroupBox groupingOptionsBox;
    552607    private System.Windows.Forms.ComboBox groupingComboBox;
     
    560615    private System.Windows.Forms.GroupBox pointsGroupBox;
    561616    private System.Windows.Forms.NumericUpDown pointOpacityNumericUpDown;
    562     private System.Windows.Forms.Label label1;
     617    private System.Windows.Forms.Label opacityLabel;
     618    private System.Windows.Forms.Label legendOrderLabel;
     619    private System.Windows.Forms.ComboBox legendOrderComboBox;
     620    private System.Windows.Forms.GroupBox legendGroupBox;
     621    private System.Windows.Forms.CheckBox legendCheckbox;
    563622  }
    564623}
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs

    r14983 r14993  
    5454      aggregationComboBox.SelectedItem = AggregationType.Overlapping;
    5555
     56      legendOrderComboBox.DataSource = Enum.GetValues(typeof(PreprocessingChartContent.LegendOrder));
     57      legendOrderComboBox.SelectedItem = PreprocessingChartContent.LegendOrder.Appearance;
     58
    5659      #region Initialize Scrollbars
    5760      columnHeaderScrollPanel.HorizontalScroll.Enabled = true;
     
    412415            rowVariable,
    413416            (string)groupingComboBox.SelectedItem,
    414             (AggregationType)aggregationComboBox.SelectedItem);
     417            (AggregationType)aggregationComboBox.SelectedItem,
     418            (PreprocessingChartContent.LegendOrder)legendOrderComboBox.SelectedItem);
    415419          dataTable.VisualProperties.Title = string.Empty;
    416           foreach (var dataRow in dataTable.Rows)
    417             dataRow.VisualProperties.IsVisibleInLegend = groupingComboBox.SelectedIndex > 0;
     420          foreach (var dataRow in dataTable.Rows) {
     421            dataRow.VisualProperties.IsVisibleInLegend = legendCheckbox.Checked && groupingComboBox.SelectedIndex > 0;
     422          }
    418423          var pcv = new DataTableView {
    419424            Name = key.ToString(),
     
    430435            colVariable,
    431436            rowVariable,
    432             (string)groupingComboBox.SelectedItem);
     437            (string)groupingComboBox.SelectedItem,
     438            (PreprocessingChartContent.LegendOrder)legendOrderComboBox.SelectedItem);
    433439          var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue;
    434440          int order = (int)polynomialRegressionOrderNumericUpDown.Value;
     
    439445            row.VisualProperties.Color = Color.FromArgb((int)(pointOpacityNumericUpDown.Value * 255),
    440446              row.VisualProperties.Color.IsEmpty ? colors[i++ % colors.Length] : row.VisualProperties.Color);
    441             //row.VisualProperties.IsVisibleInLegend = true;
     447            row.VisualProperties.IsVisibleInLegend = legendCheckbox.Checked && groupingComboBox.SelectedIndex > 0;
    442448            row.VisualProperties.IsRegressionVisibleInLegend = false;
    443449            row.VisualProperties.RegressionType = regressionType;
     
    467473    #region Generate Charts
    468474    private void GenerateCharts(bool clearCache) {
    469       if (suppressCheckedChangedUpdate) return;
     475      if (Content == null || suppressCheckedChangedUpdate) return;
    470476
    471477      // Clear old layouts and cache
     
    477483
    478484      if (clearCache) {
    479         foreach (var control in bodyCache.Values
    480           .Concat(columnHeaderCache.Values)
    481           .Concat(rowHeaderCache.Values)) {
     485        foreach (var control in bodyCache.Values.Concat(columnHeaderCache.Values).Concat(rowHeaderCache.Values)) {
    482486          control.Dispose();
    483487        }
     
    549553      }
    550554
    551       MainFormManager.MainForm.ShowContent(scatterContent, typeof(ScatterPlotSingleView));  // open in new tab
     555      MainFormManager.MainForm.ShowContent(scatterContent, typeof(ScatterPlotSingleView)); // open in new tab
    552556    }
    553557
     
    568572        }
    569573      }
    570       MainFormManager.MainForm.ShowContent(histoContent, typeof(HistogramView));  // open in new tab
     574      MainFormManager.MainForm.ShowContent(histoContent, typeof(HistogramView)); // open in new tab
    571575    }
    572576    #endregion
     
    716720    #region Grouping
    717721    private void groupingComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     722      aggregationLabel.Enabled = groupingComboBox.SelectedIndex > 0;
    718723      aggregationComboBox.Enabled = groupingComboBox.SelectedIndex > 0;
     724      legendGroupBox.Enabled = groupingComboBox.SelectedIndex > 0;
    719725      GenerateCharts(true); // new series within charts -> clear cache
    720726    }
     
    736742      }
    737743    }
     744
     745    private void legendCheckbox_CheckedChanged(object sender, EventArgs e) {
     746      foreach (var control in bodyCache.ToList()) {
     747        var histogramControl = control.Value as DataTableView;
     748        if (histogramControl != null) {
     749          foreach (var row in histogramControl.Content.Rows) {
     750            row.VisualProperties.IsVisibleInLegend = legendCheckbox.Checked && groupingComboBox.SelectedIndex > 0;
     751          }
     752        }
     753        var scatterplotControl = control.Value as ScatterPlotView;
     754        if (scatterplotControl != null) {
     755          foreach (var row in scatterplotControl.Content.Rows) {
     756            row.VisualProperties.IsVisibleInLegend = legendCheckbox.Checked && groupingComboBox.SelectedIndex > 0;
     757          }
     758        }
     759      }
     760    }
     761
     762    private void legendOrderComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     763      GenerateCharts(true);
     764    }
    738765    #endregion
    739766  }
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.Designer.cs

    r14983 r14993  
    4747      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ScatterPlotSingleView));
    4848      this.scatterPlotView = new HeuristicLab.Analysis.Views.ScatterPlotView();
    49       this.groupBox1 = new System.Windows.Forms.GroupBox();
     49      this.variablesGroupBox = new System.Windows.Forms.GroupBox();
     50      this.orderComboBox = new System.Windows.Forms.ComboBox();
     51      this.legendOrderLabel = new System.Windows.Forms.Label();
    5052      this.useGradientCheckBox = new System.Windows.Forms.CheckBox();
    51       this.label3 = new System.Windows.Forms.Label();
    52       this.label2 = new System.Windows.Forms.Label();
    53       this.label1 = new System.Windows.Forms.Label();
     53      this.groupLabel = new System.Windows.Forms.Label();
     54      this.yLabel = new System.Windows.Forms.Label();
     55      this.xLabel = new System.Windows.Forms.Label();
    5456      this.comboBoxGroup = new System.Windows.Forms.ComboBox();
    5557      this.comboBoxYVariable = new System.Windows.Forms.ComboBox();
     
    5961      this.polynomialRegressionOrderNumericUpDown = new System.Windows.Forms.NumericUpDown();
    6062      this.orderLabel = new System.Windows.Forms.Label();
    61       this.label4 = new System.Windows.Forms.Label();
    62       this.splitContainer1 = new System.Windows.Forms.SplitContainer();
     63      this.regressionTypeLabel = new System.Windows.Forms.Label();
     64      this.splitContainer = new System.Windows.Forms.SplitContainer();
    6365      this.gradientPanel = new System.Windows.Forms.Panel();
    6466      this.gradientPictureBox = new System.Windows.Forms.PictureBox();
    6567      this.gradientMinimumLabel = new System.Windows.Forms.Label();
    6668      this.gradientMaximumLabel = new System.Windows.Forms.Label();
    67       this.groupBox1.SuspendLayout();
     69      this.variablesGroupBox.SuspendLayout();
    6870      this.regressionGroupBox.SuspendLayout();
    6971      ((System.ComponentModel.ISupportInitialize)(this.polynomialRegressionOrderNumericUpDown)).BeginInit();
    70       ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
    71       this.splitContainer1.Panel1.SuspendLayout();
    72       this.splitContainer1.Panel2.SuspendLayout();
    73       this.splitContainer1.SuspendLayout();
     72      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
     73      this.splitContainer.Panel1.SuspendLayout();
     74      this.splitContainer.Panel2.SuspendLayout();
     75      this.splitContainer.SuspendLayout();
    7476      this.gradientPanel.SuspendLayout();
    7577      ((System.ComponentModel.ISupportInitialize)(this.gradientPictureBox)).BeginInit();
    7678      this.SuspendLayout();
    7779      //
    78       // ScatterPlotView
     80      // scatterPlotView
    7981      //
    8082      this.scatterPlotView.Caption = "View";
     
    8486      this.scatterPlotView.Name = "scatterPlotView";
    8587      this.scatterPlotView.ReadOnly = false;
     88      this.scatterPlotView.ShowName = true;
    8689      this.scatterPlotView.Size = new System.Drawing.Size(618, 517);
    8790      this.scatterPlotView.TabIndex = 0;
    8891      //
    89       // groupBox1
    90       //
    91       this.groupBox1.Controls.Add(this.useGradientCheckBox);
    92       this.groupBox1.Controls.Add(this.label3);
    93       this.groupBox1.Controls.Add(this.label2);
    94       this.groupBox1.Controls.Add(this.label1);
    95       this.groupBox1.Controls.Add(this.comboBoxGroup);
    96       this.groupBox1.Controls.Add(this.comboBoxYVariable);
    97       this.groupBox1.Controls.Add(this.comboBoxXVariable);
    98       this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top;
    99       this.groupBox1.Location = new System.Drawing.Point(0, 0);
    100       this.groupBox1.Name = "groupBox1";
    101       this.groupBox1.Size = new System.Drawing.Size(172, 150);
    102       this.groupBox1.TabIndex = 1;
    103       this.groupBox1.TabStop = false;
    104       this.groupBox1.Text = "Variables";
     92      // variablesGroupBox
     93      //
     94      this.variablesGroupBox.Controls.Add(this.orderComboBox);
     95      this.variablesGroupBox.Controls.Add(this.legendOrderLabel);
     96      this.variablesGroupBox.Controls.Add(this.useGradientCheckBox);
     97      this.variablesGroupBox.Controls.Add(this.groupLabel);
     98      this.variablesGroupBox.Controls.Add(this.yLabel);
     99      this.variablesGroupBox.Controls.Add(this.xLabel);
     100      this.variablesGroupBox.Controls.Add(this.comboBoxGroup);
     101      this.variablesGroupBox.Controls.Add(this.comboBoxYVariable);
     102      this.variablesGroupBox.Controls.Add(this.comboBoxXVariable);
     103      this.variablesGroupBox.Dock = System.Windows.Forms.DockStyle.Top;
     104      this.variablesGroupBox.Location = new System.Drawing.Point(0, 0);
     105      this.variablesGroupBox.Name = "variablesGroupBox";
     106      this.variablesGroupBox.Size = new System.Drawing.Size(172, 178);
     107      this.variablesGroupBox.TabIndex = 1;
     108      this.variablesGroupBox.TabStop = false;
     109      this.variablesGroupBox.Text = "Variables";
     110      //
     111      // orderComboBox
     112      //
     113      this.orderComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     114      this.orderComboBox.FormattingEnabled = true;
     115      this.orderComboBox.Location = new System.Drawing.Point(51, 144);
     116      this.orderComboBox.Name = "orderComboBox";
     117      this.orderComboBox.Size = new System.Drawing.Size(115, 21);
     118      this.orderComboBox.TabIndex = 6;
     119      this.orderComboBox.SelectedIndexChanged += new System.EventHandler(this.orderComboBox_SelectedIndexChanged);
     120      //
     121      // legendOrderLabel
     122      //
     123      this.legendOrderLabel.AutoSize = true;
     124      this.legendOrderLabel.Location = new System.Drawing.Point(6, 149);
     125      this.legendOrderLabel.Name = "legendOrderLabel";
     126      this.legendOrderLabel.Size = new System.Drawing.Size(36, 13);
     127      this.legendOrderLabel.TabIndex = 5;
     128      this.legendOrderLabel.Text = "Order:";
     129      this.legendOrderLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    105130      //
    106131      // useGradientCheckBox
     
    115140      this.useGradientCheckBox.CheckedChanged += new System.EventHandler(this.useGradientCheckBox_CheckedChanged);
    116141      //
    117       // label3
    118       //
    119       this.label3.AutoSize = true;
    120       this.label3.Location = new System.Drawing.Point(6, 97);
    121       this.label3.Name = "label3";
    122       this.label3.Size = new System.Drawing.Size(39, 13);
    123       this.label3.TabIndex = 3;
    124       this.label3.Text = "Group:";
    125       //
    126       // label2
    127       //
    128       this.label2.AutoSize = true;
    129       this.label2.Location = new System.Drawing.Point(6, 63);
    130       this.label2.Name = "label2";
    131       this.label2.Size = new System.Drawing.Size(17, 13);
    132       this.label2.TabIndex = 3;
    133       this.label2.Text = "Y:";
    134       //
    135       // label1
    136       //
    137       this.label1.AutoSize = true;
    138       this.label1.Location = new System.Drawing.Point(6, 29);
    139       this.label1.Name = "label1";
    140       this.label1.Size = new System.Drawing.Size(17, 13);
    141       this.label1.TabIndex = 2;
    142       this.label1.Text = "X:";
     142      // groupLabel
     143      //
     144      this.groupLabel.AutoSize = true;
     145      this.groupLabel.Location = new System.Drawing.Point(6, 97);
     146      this.groupLabel.Name = "groupLabel";
     147      this.groupLabel.Size = new System.Drawing.Size(39, 13);
     148      this.groupLabel.TabIndex = 3;
     149      this.groupLabel.Text = "Group:";
     150      //
     151      // yLabel
     152      //
     153      this.yLabel.AutoSize = true;
     154      this.yLabel.Location = new System.Drawing.Point(6, 63);
     155      this.yLabel.Name = "yLabel";
     156      this.yLabel.Size = new System.Drawing.Size(17, 13);
     157      this.yLabel.TabIndex = 3;
     158      this.yLabel.Text = "Y:";
     159      //
     160      // xLabel
     161      //
     162      this.xLabel.AutoSize = true;
     163      this.xLabel.Location = new System.Drawing.Point(6, 29);
     164      this.xLabel.Name = "xLabel";
     165      this.xLabel.Size = new System.Drawing.Size(17, 13);
     166      this.xLabel.TabIndex = 2;
     167      this.xLabel.Text = "X:";
    143168      //
    144169      // comboBoxGroup
    145170      //
    146       this.comboBoxGroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     171      this.comboBoxGroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    147172            | System.Windows.Forms.AnchorStyles.Right)));
    148173      this.comboBoxGroup.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
     
    159184      // comboBoxYVariable
    160185      //
    161       this.comboBoxYVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     186      this.comboBoxYVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    162187            | System.Windows.Forms.AnchorStyles.Right)));
    163188      this.comboBoxYVariable.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
     
    173198      // comboBoxXVariable
    174199      //
    175       this.comboBoxXVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     200      this.comboBoxXVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    176201            | System.Windows.Forms.AnchorStyles.Right)));
    177202      this.comboBoxXVariable.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
     
    190215      this.regressionGroupBox.Controls.Add(this.polynomialRegressionOrderNumericUpDown);
    191216      this.regressionGroupBox.Controls.Add(this.orderLabel);
    192       this.regressionGroupBox.Controls.Add(this.label4);
     217      this.regressionGroupBox.Controls.Add(this.regressionTypeLabel);
    193218      this.regressionGroupBox.Dock = System.Windows.Forms.DockStyle.Top;
    194       this.regressionGroupBox.Location = new System.Drawing.Point(0, 150);
     219      this.regressionGroupBox.Location = new System.Drawing.Point(0, 178);
    195220      this.regressionGroupBox.Name = "regressionGroupBox";
    196221      this.regressionGroupBox.Size = new System.Drawing.Size(172, 78);
     
    201226      // regressionTypeComboBox
    202227      //
    203       this.regressionTypeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     228      this.regressionTypeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    204229            | System.Windows.Forms.AnchorStyles.Right)));
    205230      this.regressionTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     
    213238      // polynomialRegressionOrderNumericUpDown
    214239      //
    215       this.polynomialRegressionOrderNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     240      this.polynomialRegressionOrderNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    216241            | System.Windows.Forms.AnchorStyles.Right)));
    217242      this.polynomialRegressionOrderNumericUpDown.Location = new System.Drawing.Point(51, 47);
     
    246271      this.orderLabel.Text = "Order:";
    247272      //
    248       // label4
    249       //
    250       this.label4.AutoSize = true;
    251       this.label4.Location = new System.Drawing.Point(6, 22);
    252       this.label4.Name = "label4";
    253       this.label4.Size = new System.Drawing.Size(34, 13);
    254       this.label4.TabIndex = 13;
    255       this.label4.Text = "Type:";
    256       //
    257       // splitContainer1
    258       //
    259       this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
    260       this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
    261       this.splitContainer1.Location = new System.Drawing.Point(0, 0);
    262       this.splitContainer1.Name = "splitContainer1";
    263       //
    264       // splitContainer1.Panel1
    265       //
    266       this.splitContainer1.Panel1.Controls.Add(this.regressionGroupBox);
    267       this.splitContainer1.Panel1.Controls.Add(this.groupBox1);
    268       //
    269       // splitContainer1.Panel2
    270       //
    271       this.splitContainer1.Panel2.Controls.Add(this.scatterPlotView);
    272       this.splitContainer1.Panel2.Controls.Add(this.gradientPanel);
    273       this.splitContainer1.Size = new System.Drawing.Size(863, 517);
    274       this.splitContainer1.SplitterDistance = 172;
    275       this.splitContainer1.TabIndex = 5;
     273      // regressionTypeLabel
     274      //
     275      this.regressionTypeLabel.AutoSize = true;
     276      this.regressionTypeLabel.Location = new System.Drawing.Point(6, 22);
     277      this.regressionTypeLabel.Name = "regressionTypeLabel";
     278      this.regressionTypeLabel.Size = new System.Drawing.Size(34, 13);
     279      this.regressionTypeLabel.TabIndex = 13;
     280      this.regressionTypeLabel.Text = "Type:";
     281      //
     282      // splitContainer
     283      //
     284      this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
     285      this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
     286      this.splitContainer.Location = new System.Drawing.Point(0, 0);
     287      this.splitContainer.Name = "splitContainer";
     288      //
     289      // splitContainer.Panel1
     290      //
     291      this.splitContainer.Panel1.Controls.Add(this.regressionGroupBox);
     292      this.splitContainer.Panel1.Controls.Add(this.variablesGroupBox);
     293      //
     294      // splitContainer.Panel2
     295      //
     296      this.splitContainer.Panel2.Controls.Add(this.scatterPlotView);
     297      this.splitContainer.Panel2.Controls.Add(this.gradientPanel);
     298      this.splitContainer.Size = new System.Drawing.Size(863, 517);
     299      this.splitContainer.SplitterDistance = 172;
     300      this.splitContainer.TabIndex = 5;
    276301      //
    277302      // gradientPanel
     
    288313      // gradientPictureBox
    289314      //
    290       this.gradientPictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     315      this.gradientPictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    291316            | System.Windows.Forms.AnchorStyles.Left)));
    292317      this.gradientPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     
    325350      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    326351      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    327       this.Controls.Add(this.splitContainer1);
     352      this.Controls.Add(this.splitContainer);
    328353      this.Name = "ScatterPlotSingleView";
    329354      this.Size = new System.Drawing.Size(863, 517);
    330       this.groupBox1.ResumeLayout(false);
    331       this.groupBox1.PerformLayout();
     355      this.variablesGroupBox.ResumeLayout(false);
     356      this.variablesGroupBox.PerformLayout();
    332357      this.regressionGroupBox.ResumeLayout(false);
    333358      this.regressionGroupBox.PerformLayout();
    334359      ((System.ComponentModel.ISupportInitialize)(this.polynomialRegressionOrderNumericUpDown)).EndInit();
    335       this.splitContainer1.Panel1.ResumeLayout(false);
    336       this.splitContainer1.Panel2.ResumeLayout(false);
    337       ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
    338       this.splitContainer1.ResumeLayout(false);
     360      this.splitContainer.Panel1.ResumeLayout(false);
     361      this.splitContainer.Panel2.ResumeLayout(false);
     362      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
     363      this.splitContainer.ResumeLayout(false);
    339364      this.gradientPanel.ResumeLayout(false);
    340365      ((System.ComponentModel.ISupportInitialize)(this.gradientPictureBox)).EndInit();
     
    346371
    347372    private HeuristicLab.Analysis.Views.ScatterPlotView scatterPlotView;
    348     private System.Windows.Forms.GroupBox groupBox1;
    349     private System.Windows.Forms.Label label2;
    350     private System.Windows.Forms.Label label1;
     373    private System.Windows.Forms.GroupBox variablesGroupBox;
     374    private System.Windows.Forms.Label yLabel;
     375    private System.Windows.Forms.Label xLabel;
    351376    private System.Windows.Forms.ComboBox comboBoxYVariable;
    352377    private System.Windows.Forms.ComboBox comboBoxXVariable;
    353378    private System.Windows.Forms.ComboBox comboBoxGroup;
    354     private System.Windows.Forms.Label label3;
     379    private System.Windows.Forms.Label groupLabel;
    355380    private System.Windows.Forms.GroupBox regressionGroupBox;
    356381    private System.Windows.Forms.ComboBox regressionTypeComboBox;
    357382    private System.Windows.Forms.NumericUpDown polynomialRegressionOrderNumericUpDown;
    358383    private System.Windows.Forms.Label orderLabel;
    359     private System.Windows.Forms.Label label4;
    360     private System.Windows.Forms.SplitContainer splitContainer1;
     384    private System.Windows.Forms.Label regressionTypeLabel;
     385    private System.Windows.Forms.SplitContainer splitContainer;
    361386    private System.Windows.Forms.CheckBox useGradientCheckBox;
    362387    private System.Windows.Forms.Panel gradientPanel;
     
    364389    private System.Windows.Forms.Label gradientMaximumLabel;
    365390    private System.Windows.Forms.PictureBox gradientPictureBox;
     391    private System.Windows.Forms.Label legendOrderLabel;
     392    private System.Windows.Forms.ComboBox orderComboBox;
    366393  }
    367394}
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.cs

    r14983 r14993  
    4848      regressionTypeComboBox.DataSource = Enum.GetValues(typeof(RegressionType));
    4949      regressionTypeComboBox.SelectedItem = RegressionType.None;
     50      orderComboBox.DataSource = Enum.GetValues(typeof(PreprocessingChartContent.LegendOrder));
     51      orderComboBox.SelectedItem = PreprocessingChartContent.LegendOrder.Appearance;
    5052    }
    5153
     
    7375      comboBoxYVariable.Items.AddRange(variables.ToArray());
    7476      comboBoxGroup.Items.Add(NoGroupItem);
    75       foreach (string var in PreprocessingChartContent.GetVariableNamesForGrouping(Content.PreprocessingData)) {
     77      foreach (string var in Content.PreprocessingData.VariableNames) {
    7678        comboBoxGroup.Items.Add(var);
    7779      }
     
    98100        var yVariable = (string)comboBoxYVariable.SelectedItem;
    99101        var groupVariable = (string)comboBoxGroup.SelectedItem;
    100 
    101         ScatterPlot scatterPlot = ScatterPlotContent.CreateScatterPlot(Content.PreprocessingData, xVariable, yVariable, groupVariable);
     102        var legendOrder = (PreprocessingChartContent.LegendOrder)orderComboBox.SelectedItem;
     103
     104        ScatterPlot scatterPlot = ScatterPlotContent.CreateScatterPlot(Content.PreprocessingData, xVariable, yVariable, groupVariable, legendOrder);
    102105        //rows are saved and removed to avoid firing of visual property changed events
    103106        var rows = scatterPlot.Rows.ToList();
     
    237240      return colors[index];
    238241    }
     242
     243    private void orderComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     244      UpdateScatterPlot();
     245    }
    239246  }
    240247}
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/HistogramContent.cs

    r14725 r14993  
    3939    public bool ExactBins { get; set; }
    4040
     41    public LegendOrder Order { get; set; }
     42
    4143    public HistogramContent(IFilteredPreprocessingData preprocessingData)
    4244      : base(preprocessingData) {
     
    5254    }
    5355
    54     public static DataTable CreateHistogram(IFilteredPreprocessingData preprocessingData, string variableName, string groupingVariableName, DataRowVisualProperties.DataRowHistogramAggregation aggregation) {
    55       {
    56         var dataTable = new DataTable();
     56    public static DataTable CreateHistogram(IFilteredPreprocessingData preprocessingData, string variableName, string groupingVariableName, DataRowVisualProperties.DataRowHistogramAggregation aggregation, LegendOrder legendOrder = LegendOrder.Appearance) {
     57      var dataTable = new DataTable();
    5758
    58         if (string.IsNullOrEmpty(groupingVariableName)) {
    59           var row = PreprocessingChartContent.CreateDataRow(preprocessingData, variableName, DataRowVisualProperties.DataRowChartType.Histogram);
    60           dataTable.Rows.Add(row);
    61           return dataTable;
    62         }
    63 
    64         dataTable.VisualProperties.Title = variableName;
    65 
    66         int variableIndex = preprocessingData.GetColumnIndex(variableName);
    67         var variableValues = preprocessingData.GetValues<double>(variableIndex);
    68         int groupVariableIndex = preprocessingData.GetColumnIndex(groupingVariableName);
    69         var groupingValues = Enumerable.Empty<string>();
    70 
    71         if (preprocessingData.VariableHasType<double>(groupVariableIndex)) {
    72           groupingValues = preprocessingData.GetValues<double>(groupVariableIndex).Select(x => x.ToString());
    73         } else if (preprocessingData.VariableHasType<string>(groupVariableIndex)) {
    74           groupingValues = preprocessingData.GetValues<string>(groupVariableIndex);
    75         } else if (preprocessingData.VariableHasType<DateTime>(groupVariableIndex)) {
    76           groupingValues = preprocessingData.GetValues<DateTime>(groupVariableIndex).Select(x => x.ToString());
    77         }
    78 
    79         var groups = groupingValues.Zip(variableValues, Tuple.Create).GroupBy(t => t.Item1, t => t.Item2);
    80 
    81         foreach (var group in groups) {
    82           var classRow = new DataRow();
    83           classRow.Name = group.Key;
    84           classRow.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram;
    85           classRow.VisualProperties.Aggregation = aggregation;
    86           classRow.Values.AddRange(group);
    87           dataTable.Rows.Add(classRow);
    88         }
     59      if (string.IsNullOrEmpty(groupingVariableName)) {
     60        var row = PreprocessingChartContent.CreateDataRow(preprocessingData, variableName, DataRowVisualProperties.DataRowChartType.Histogram);
     61        dataTable.Rows.Add(row);
    8962        return dataTable;
    9063      }
     64
     65      dataTable.VisualProperties.Title = variableName;
     66
     67      int variableIndex = preprocessingData.GetColumnIndex(variableName);
     68      var variableValues = preprocessingData.GetValues<double>(variableIndex);
     69      int groupVariableIndex = preprocessingData.GetColumnIndex(groupingVariableName);
     70      var groupingValues = Enumerable.Empty<string>();
     71
     72      if (preprocessingData.VariableHasType<double>(groupVariableIndex)) {
     73        groupingValues = preprocessingData.GetValues<double>(groupVariableIndex).Select(x => x.ToString());
     74      } else if (preprocessingData.VariableHasType<string>(groupVariableIndex)) {
     75        groupingValues = preprocessingData.GetValues<string>(groupVariableIndex);
     76      } else if (preprocessingData.VariableHasType<DateTime>(groupVariableIndex)) {
     77        groupingValues = preprocessingData.GetValues<DateTime>(groupVariableIndex).Select(x => x.ToString());
     78      }
     79
     80      var groups = groupingValues.Zip(variableValues, Tuple.Create).GroupBy(t => t.Item1, t => t.Item2);
     81
     82      if (legendOrder == LegendOrder.Alphabetically)
     83        groups = groups.OrderBy(x => x.Key, new NaturalStringComparer());
     84
     85      foreach (var group in groups) {
     86        var classRow = new DataRow {
     87          Name = group.Key,
     88          VisualProperties = {
     89              ChartType = DataRowVisualProperties.DataRowChartType.Histogram,
     90              Aggregation = aggregation
     91            }
     92        };
     93        classRow.Values.AddRange(group);
     94        dataTable.Rows.Add(classRow);
     95      }
     96      return dataTable;
    9197    }
    92 
    93 
    9498  }
    9599}
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/PreprocessingChartContent.cs

    r14725 r14993  
    3333  [Item("PreprocessingChart", "Represents a preprocessing chart.")]
    3434  public class PreprocessingChartContent : Item, IViewShortcut {
     35
     36    public enum LegendOrder {
     37      Appearance,
     38      Alphabetically
     39    }
     40
    3541    public static new Image StaticItemImage {
    3642      get { return VSImageLibrary.PieChart; }
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/ScatterPlotContent.cs

    r14725 r14993  
    4040    }
    4141
    42     public static ScatterPlot CreateScatterPlot(IFilteredPreprocessingData preprocessingData, string variableNameX, string variableNameY, string variableNameGroup = "-") {
     42    public static ScatterPlot CreateScatterPlot(IFilteredPreprocessingData preprocessingData, string variableNameX, string variableNameY, string variableNameGroup = "-", LegendOrder legendOrder = LegendOrder.Appearance) {
    4343      ScatterPlot scatterPlot = new ScatterPlot();
    4444
     
    5656          scatterPlot.VisualProperties.XAxisMinimumFixedValue = axisMin;
    5757          scatterPlot.VisualProperties.XAxisMaximumFixedValue = axisMax;
    58         }
    59         catch (ArgumentOutOfRangeException) { } // error during CalculateOptimalAxisInterval
     58        } catch (ArgumentOutOfRangeException) { } // error during CalculateOptimalAxisInterval
    6059        try {
    6160          double axisMin, axisMax, axisInterval;
     
    6564          scatterPlot.VisualProperties.YAxisMinimumFixedValue = axisMin;
    6665          scatterPlot.VisualProperties.YAxisMaximumFixedValue = axisMax;
    67         }
    68         catch (ArgumentOutOfRangeException) { } // error during CalculateOptimalAxisInterval
     66        } catch (ArgumentOutOfRangeException) { } // error during CalculateOptimalAxisInterval
    6967      }
    7068
     
    9189      var groups = groupingValues.Zip(validPoints, Tuple.Create).GroupBy(t => t.Item1, t => t.Item2);
    9290
     91      if (legendOrder == LegendOrder.Alphabetically)
     92        groups = groups.OrderBy(x => x.Key, new NaturalStringComparer());
     93
    9394      foreach (var group in groups) {
    94         var scdr = new ScatterPlotDataRow();
    95         scdr.Name = group.Key;
    96         scdr.VisualProperties.IsVisibleInLegend = true;
    97         scdr.VisualProperties.PointSize = 6;
     95        var scdr = new ScatterPlotDataRow {
     96          Name = group.Key,
     97          VisualProperties = {
     98            IsVisibleInLegend = true,
     99            PointSize = 6
     100          }
     101        };
    98102        scdr.Points.AddRange(group);
    99103        scatterPlot.Rows.Add(scdr);
Note: See TracChangeset for help on using the changeset viewer.