- Timestamp:
- 04/09/14 13:41:30 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingChartView.cs
r10736 r10741 66 66 } else { 67 67 DataRow row = GetDataRow(variableName); 68 //row.VisualProperties.Color = GetRandomColor();69 68 dataTable.Rows.Add(row); 70 69 DataTable d = new DataTable(variableName); … … 77 76 GenerateChart(); 78 77 79 }80 81 private Color GetRandomColor() {82 Random randomGen = new Random();83 KnownColor[] names = (KnownColor[])Enum.GetValues(typeof(KnownColor));84 KnownColor randomColorName = names[randomGen.Next(names.Length)];85 Color randomColor = Color.FromKnownColor(randomColorName);86 return randomColor;87 78 } 88 79 … … 127 118 DataTable d = new DataTable(variableName); 128 119 DataRow row = GetDataRow(variableName); 129 //row.VisualProperties.Color = GetRandomColor();130 120 d.Rows.Add(row); 131 121 dataTablePerVariable.Add(d); … … 156 146 switch (e.Type) { 157 147 case DataPreprocessingChangedEventType.DeleteColumn: 158 //RemoveVariable(logic.GetVariableNameByIndex(e.Column));148 RemoveVariable(logic.GetVariableNameByIndex(e.Column)); 159 149 break; 160 150 case DataPreprocessingChangedEventType.AddColumn: 161 //AddVariable(logic.GetVariableNameByIndex(e.Column));151 AddVariable(logic.GetVariableNameByIndex(e.Column)); 162 152 break; 163 153 case DataPreprocessingChangedEventType.ChangeColumn: … … 169 159 case DataPreprocessingChangedEventType.Any: 170 160 InitData(); 171 GenerateChart(); 172 161 GenerateChart(); 173 162 break; 174 163 } … … 188 177 // add variable to data table and item list 189 178 private void AddVariable(string name) { 190 dataTable.Rows.Add(logic.CreateDataRow(name, chartType)); 179 DataRow row = logic.CreateDataRow(name, chartType); 180 dataTable.Rows.Add(row); 181 DataTable d = new DataTable(name); 182 d.Rows.Add(row); 183 dataTablePerVariable.Add(d); 191 184 variableItemList.Add(new StringValue(name)); 185 if (!allInOneMode) 186 GenerateChart(); 192 187 } 193 188 … … 195 190 private void RemoveVariable(string name) { 196 191 dataTable.Rows.Remove(name); 192 dataTablePerVariable.Remove(dataTablePerVariable.Find(x => (x.Name == name))); 197 193 198 194 StringValue stringValue = FindVariableItemList(name); 199 195 if (stringValue != null) 200 196 variableItemList.Remove(stringValue); 201 197 if (!allInOneMode) 198 GenerateChart(); 202 199 } 203 200
Note: See TracChangeset
for help on using the changeset viewer.