Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.Designer.cs	(revision 8838)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.Designer.cs	(revision 8840)
@@ -1,3 +1,4 @@
-﻿namespace HeuristicLab.Problems.DataAnalysis.Views {
+﻿using System.Windows.Forms.DataVisualization.Charting;
+namespace HeuristicLab.Problems.DataAnalysis.Views {
   partial class DiscriminantFunctionClassificationSolutionThresholdView {
     /// <summary> 
@@ -53,4 +54,5 @@
       this.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown);
       this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove);
+      this.chart.PostPaint += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.ChartPaintEventArgs>(chart_PostPaint);
       // 
       // JitterTrackBar
@@ -92,5 +94,4 @@
 
     }
-
     #endregion
 
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.cs	(revision 8838)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.cs	(revision 8840)
@@ -40,4 +40,7 @@
     private const string TestLabelText = "Test Samples";
 
+    private const double ClassNameLeftOffset = 10.0;
+    private const double ClassNameBottomOffset = 5.0;
+
     public new IDiscriminantFunctionClassificationSolution Content {
       get { return (IDiscriminantFunctionClassificationSolution)base.Content; }
@@ -47,5 +50,5 @@
     private Dictionary<double, Series> classValueSeriesMapping;
     private Random random;
-    private bool updateInProgress;
+    private bool updateInProgress, updateThresholds;
 
     public DiscriminantFunctionClassificationSolutionThresholdView()
@@ -126,5 +129,5 @@
             FillSeriesWithDataPoints(series);
           }
-          AddThresholds();
+          updateThresholds = true;
         }
         chart.ChartAreas[0].RecalculateAxesScale();
@@ -166,7 +169,21 @@
     }
 
+    private void chart_PostPaint(object sender, ChartPaintEventArgs e) {
+      if (updateThresholds) {
+        AddThresholds();
+        updateThresholds = false;
+      }
+    }
+
     private void AddThresholds() {
       chart.Annotations.Clear();
       int classIndex = 1;
+      SizeF textSizeInPixel;
+      IClassificationProblemData problemData = Content.ProblemData;
+      var classValues = Content.Model.ClassValues.ToArray();
+      Graphics g = chart.CreateGraphics();
+      Axis y = chart.ChartAreas[0].AxisY;
+      Axis x = chart.ChartAreas[0].AxisX;
+      string name;
       foreach (double threshold in Content.Model.Thresholds) {
         if (!double.IsInfinity(threshold)) {
@@ -176,17 +193,56 @@
           annotation.LineWidth = 2;
           annotation.LineColor = Color.Red;
-
           annotation.IsInfinitive = true;
           annotation.ClipToChartArea = chart.ChartAreas[0].Name;
           annotation.Tag = classIndex;  //save classIndex as Tag to avoid moving the threshold accross class bounderies
-
           annotation.AxisX = chart.ChartAreas[0].AxisX;
-          annotation.AxisY = chart.ChartAreas[0].AxisY;
+          annotation.AxisY = y;
           annotation.Y = threshold;
 
+          name = problemData.GetClassName(classValues[classIndex - 1]);
+          TextAnnotation beneathLeft = CreateTextAnnotation(name, classIndex, x, y);
+          beneathLeft.Y = threshold;
+          beneathLeft.X = x.Minimum;
+          TextAnnotation beneathRigth = CreateTextAnnotation(name, classIndex, x, y);
+          beneathRigth.Y = threshold;
+          textSizeInPixel = g.MeasureString(beneathRigth.Text, beneathRigth.Font);
+          double textWidthPixelPos = x.ValueToPixelPosition(x.Maximum) - textSizeInPixel.Width - ClassNameLeftOffset;
+          //check if position is within the position boundary
+          beneathRigth.X = textWidthPixelPos < 0 || textWidthPixelPos > chart.Width ? double.NaN : x.PixelPositionToValue(textWidthPixelPos);
+
+          name = problemData.GetClassName(classValues[classIndex]);
+          TextAnnotation aboveLeft = CreateTextAnnotation(name, classIndex, x, y);
+          textSizeInPixel = g.MeasureString(aboveLeft.Text, aboveLeft.Font);
+          double textHeightPixelPos = y.ValueToPixelPosition(threshold) - textSizeInPixel.Height - ClassNameBottomOffset;
+          //check if position is within the position boundary
+          aboveLeft.Y = textHeightPixelPos < 0 || textHeightPixelPos > chart.Height ? double.NaN : y.PixelPositionToValue(textHeightPixelPos);
+          aboveLeft.X = x.Minimum;
+          TextAnnotation aboveRight = CreateTextAnnotation(name, classIndex, x, y);
+          aboveRight.Y = aboveLeft.Y;
+          textWidthPixelPos = x.ValueToPixelPosition(x.Maximum) - textSizeInPixel.Width - ClassNameLeftOffset;
+          //check if position is within the position boundary
+          aboveRight.X = textWidthPixelPos < 0 || textWidthPixelPos > chart.Width ? double.NaN : x.PixelPositionToValue(textWidthPixelPos);
+
           chart.Annotations.Add(annotation);
+          chart.Annotations.Add(beneathLeft);
+          chart.Annotations.Add(aboveLeft);
+          chart.Annotations.Add(beneathRigth);
+          chart.Annotations.Add(aboveRight);
           classIndex++;
         }
       }
+    }
+
+    private TextAnnotation CreateTextAnnotation(string name, int classIndex, Axis x, Axis y) {
+      TextAnnotation annotation = new TextAnnotation();
+      annotation.Text = name;
+      annotation.AllowMoving = true;
+      annotation.AllowResizing = false;
+      annotation.AllowSelecting = false;
+      annotation.ClipToChartArea = chart.ChartAreas[0].Name;
+      annotation.Tag = classIndex;
+      annotation.AxisX = chart.ChartAreas[0].AxisX;
+      annotation.AxisY = y;
+      return annotation;
     }
 
