Free cookie consent management tool by TermsFeed Policy Generator

source: branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HistogramView.cs @ 10908

Last change on this file since 10908 was 10908, checked in by mleitner, 10 years ago

Add Feature correlation matrix, Add limit for distinct values in histogramm classification.

File size: 1.7 KB
Line 
1using System;
2using System.Windows.Forms;
3using HeuristicLab.Analysis;
4using HeuristicLab.MainForm;
5
6namespace HeuristicLab.DataPreprocessing.Views {
7
8  [View("Histogram View")]
9  [Content(typeof(HistogramContent), true)]
10  public partial class HistogramView : PreprocessingChartView {
11    private const string HISTOGRAM_CHART_TITLE = "Histogram";
12
13    public HistogramView() {
14      InitializeComponent();
15      chartType = DataRowVisualProperties.DataRowChartType.Histogram;
16      chartTitle = HISTOGRAM_CHART_TITLE;
17    }
18
19    protected override void OnContentChanged()
20    {
21      base.OnContentChanged();
22      if (Content != null)
23      {
24        logic = Content.ChartLogic;
25   
26        classifierComboBox.Items.Clear();
27        classifierComboBox.Items.Add("None");
28
29        foreach(string var in logic.GetVariableNamesForHistogramClassification()){
30          classifierComboBox.Items.Add(var);
31        }
32
33     
34        if (classifierComboBox.SelectedItem == null) {
35          classifierComboBox.SelectedIndex = Content.ClassifierVariableIndex;
36        }
37      }
38    }
39
40    public new HistogramContent Content {
41      get { return (HistogramContent)base.Content; }
42      set { base.Content = value; }
43    }
44
45    private void classifierComboBox_SelectedIndexChanged(object sender, EventArgs e) {
46      if (classifierComboBox.SelectedItem == null)
47        return;
48
49      if (classifierComboBox.SelectedIndex != 0) {
50        Classification = logic.GetVariableValues(classifierComboBox.SelectedItem.ToString());
51      } else {
52        Classification = null;
53      }
54
55      Content.ClassifierVariableIndex = classifierComboBox.SelectedIndex;
56
57      GenerateChart();
58    }
59  }
60}
Note: See TracBrowser for help on using the repository browser.