Changeset 14993 for branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs
- Timestamp:
- 05/17/17 13:22:51 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs
r14983 r14993 54 54 aggregationComboBox.SelectedItem = AggregationType.Overlapping; 55 55 56 legendOrderComboBox.DataSource = Enum.GetValues(typeof(PreprocessingChartContent.LegendOrder)); 57 legendOrderComboBox.SelectedItem = PreprocessingChartContent.LegendOrder.Appearance; 58 56 59 #region Initialize Scrollbars 57 60 columnHeaderScrollPanel.HorizontalScroll.Enabled = true; … … 412 415 rowVariable, 413 416 (string)groupingComboBox.SelectedItem, 414 (AggregationType)aggregationComboBox.SelectedItem); 417 (AggregationType)aggregationComboBox.SelectedItem, 418 (PreprocessingChartContent.LegendOrder)legendOrderComboBox.SelectedItem); 415 419 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 } 418 423 var pcv = new DataTableView { 419 424 Name = key.ToString(), … … 430 435 colVariable, 431 436 rowVariable, 432 (string)groupingComboBox.SelectedItem); 437 (string)groupingComboBox.SelectedItem, 438 (PreprocessingChartContent.LegendOrder)legendOrderComboBox.SelectedItem); 433 439 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 434 440 int order = (int)polynomialRegressionOrderNumericUpDown.Value; … … 439 445 row.VisualProperties.Color = Color.FromArgb((int)(pointOpacityNumericUpDown.Value * 255), 440 446 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; 442 448 row.VisualProperties.IsRegressionVisibleInLegend = false; 443 449 row.VisualProperties.RegressionType = regressionType; … … 467 473 #region Generate Charts 468 474 private void GenerateCharts(bool clearCache) { 469 if ( suppressCheckedChangedUpdate) return;475 if (Content == null || suppressCheckedChangedUpdate) return; 470 476 471 477 // Clear old layouts and cache … … 477 483 478 484 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)) { 482 486 control.Dispose(); 483 487 } … … 549 553 } 550 554 551 MainFormManager.MainForm.ShowContent(scatterContent, typeof(ScatterPlotSingleView)); 555 MainFormManager.MainForm.ShowContent(scatterContent, typeof(ScatterPlotSingleView)); // open in new tab 552 556 } 553 557 … … 568 572 } 569 573 } 570 MainFormManager.MainForm.ShowContent(histoContent, typeof(HistogramView)); 574 MainFormManager.MainForm.ShowContent(histoContent, typeof(HistogramView)); // open in new tab 571 575 } 572 576 #endregion … … 716 720 #region Grouping 717 721 private void groupingComboBox_SelectedIndexChanged(object sender, EventArgs e) { 722 aggregationLabel.Enabled = groupingComboBox.SelectedIndex > 0; 718 723 aggregationComboBox.Enabled = groupingComboBox.SelectedIndex > 0; 724 legendGroupBox.Enabled = groupingComboBox.SelectedIndex > 0; 719 725 GenerateCharts(true); // new series within charts -> clear cache 720 726 } … … 736 742 } 737 743 } 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 } 738 765 #endregion 739 766 }
Note: See TracChangeset
for help on using the changeset viewer.