Changeset 9363 for branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.cs
- Timestamp:
- 04/16/13 13:13:41 (12 years ago)
- Location:
- branches/OaaS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 23 24 packages
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views
- Property svn:mergeinfo changed
-
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.cs
r8139 r9363 65 65 66 66 this.chart.ChartAreas[0].AxisY.Title = "Estimated Values"; 67 this.chart.ChartAreas[0].AxisY.IsStartedFromZero = false; 67 68 this.chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true; 68 69 this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true; … … 169 170 chart.Annotations.Clear(); 170 171 int classIndex = 1; 172 IClassificationProblemData problemData = Content.ProblemData; 173 var classValues = Content.Model.ClassValues.ToArray(); 174 Axis y = chart.ChartAreas[0].AxisY; 175 Axis x = chart.ChartAreas[0].AxisX; 176 string name; 171 177 foreach (double threshold in Content.Model.Thresholds) { 172 178 if (!double.IsInfinity(threshold)) { … … 176 182 annotation.LineWidth = 2; 177 183 annotation.LineColor = Color.Red; 178 179 184 annotation.IsInfinitive = true; 180 185 annotation.ClipToChartArea = chart.ChartAreas[0].Name; 181 186 annotation.Tag = classIndex; //save classIndex as Tag to avoid moving the threshold accross class bounderies 182 183 187 annotation.AxisX = chart.ChartAreas[0].AxisX; 184 annotation.AxisY = chart.ChartAreas[0].AxisY;188 annotation.AxisY = y; 185 189 annotation.Y = threshold; 186 190 191 name = problemData.GetClassName(classValues[classIndex - 1]); 192 TextAnnotation beneathLeft = CreateTextAnnotation(name, classIndex, x, y, x.Minimum, threshold, ContentAlignment.TopLeft); 193 TextAnnotation beneathRight = CreateTextAnnotation(name, classIndex, x, y, x.Maximum, threshold, ContentAlignment.TopRight); 194 195 name = problemData.GetClassName(classValues[classIndex]); 196 TextAnnotation aboveLeft = CreateTextAnnotation(name, classIndex, x, y, x.Minimum, threshold, ContentAlignment.BottomLeft); 197 TextAnnotation aboveRight = CreateTextAnnotation(name, classIndex, x, y, x.Maximum, threshold, ContentAlignment.BottomRight); 198 187 199 chart.Annotations.Add(annotation); 200 chart.Annotations.Add(beneathLeft); 201 chart.Annotations.Add(aboveLeft); 202 chart.Annotations.Add(beneathRight); 203 chart.Annotations.Add(aboveRight); 204 205 beneathLeft.ResizeToContent(); 206 beneathRight.ResizeToContent(); 207 aboveLeft.ResizeToContent(); 208 aboveRight.ResizeToContent(); 209 210 beneathRight.Width = -beneathRight.Width; 211 aboveLeft.Height = -aboveLeft.Height; 212 aboveRight.Height = -aboveRight.Height; 213 aboveRight.Width = -aboveRight.Width; 214 188 215 classIndex++; 189 216 } 190 217 } 218 } 219 220 private TextAnnotation CreateTextAnnotation(string name, int classIndex, Axis axisX, Axis axisY, double x, double y, ContentAlignment alignment) { 221 TextAnnotation annotation = new TextAnnotation(); 222 annotation.Text = name; 223 annotation.AllowMoving = true; 224 annotation.AllowResizing = false; 225 annotation.AllowSelecting = false; 226 annotation.IsSizeAlwaysRelative = true; 227 annotation.ClipToChartArea = chart.ChartAreas[0].Name; 228 annotation.Tag = classIndex; 229 annotation.AxisX = axisX; 230 annotation.AxisY = axisY; 231 annotation.Alignment = alignment; 232 annotation.X = x; 233 annotation.Y = y; 234 return annotation; 191 235 } 192 236 … … 238 282 double[] thresholds = Content.Model.Thresholds.ToArray(); 239 283 thresholds[classIndex] = e.NewLocationY; 284 Array.Sort(thresholds); 240 285 Content.Model.SetThresholdsAndClassValues(thresholds, Content.Model.ClassValues); 241 286 }
Note: See TracChangeset
for help on using the changeset viewer.