Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/15/10 13:08:12 (14 years ago)
Author:
mkommend
Message:

updated classification views (ticket #939)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/SymbolicClassificationSolutionView.cs

    r4367 r4394  
    2626using System.Windows.Forms;
    2727using System.Windows.Forms.DataVisualization.Charting;
     28using HeuristicLab.Common;
    2829using HeuristicLab.MainForm;
    2930using HeuristicLab.MainForm.WindowsForms;
     
    6970      CustomLabel trainingLabel = new CustomLabel();
    7071      trainingLabel.Text = TrainingLabelText;
    71       trainingLabel.GridTicks = GridTickTypes.TickMark;
    7272      trainingLabel.FromPosition = TrainingAxisValue - TrainingTestBorder;
    7373      trainingLabel.ToPosition = TrainingAxisValue + TrainingTestBorder;
     
    7676      CustomLabel testLabel = new CustomLabel();
    7777      testLabel.Text = TestLabelText;
    78       testLabel.GridTicks = GridTickTypes.TickMark;
    7978      testLabel.FromPosition = TestAxisValue - TrainingTestBorder;
    8079      testLabel.ToPosition = TestAxisValue + TrainingTestBorder;
     
    160159        row++;
    161160      }
     161      UpdateCursorInterval();
    162162    }
    163163
     
    245245      Content.Thresholds = thresholds;
    246246    }
     247
     248    private void UpdateCursorInterval() {
     249      Series series = chart.Series[0];
     250      double[] xValues = (from point in series.Points
     251                          where !point.IsEmpty
     252                          select point.XValue)
     253                    .DefaultIfEmpty(1.0)
     254                    .ToArray();
     255      double[] yValues = (from point in series.Points
     256                          where !point.IsEmpty
     257                          select point.YValues[0])
     258                    .DefaultIfEmpty(1.0)
     259                    .ToArray();
     260
     261      double xRange = xValues.Max() - xValues.Min();
     262      double yRange = yValues.Max() - yValues.Min();
     263      if (xRange.IsAlmost(0.0)) xRange = 1.0;
     264      if (yRange.IsAlmost(0.0)) yRange = 1.0;
     265      double xDigits = (int)Math.Log10(xRange) - 3;
     266      double yDigits = (int)Math.Log10(yRange) - 3;
     267      double xZoomInterval = Math.Pow(10, xDigits);
     268      double yZoomInterval = Math.Pow(10, yDigits);
     269      this.chart.ChartAreas[0].CursorX.Interval = xZoomInterval;
     270      this.chart.ChartAreas[0].CursorY.Interval = yZoomInterval;
     271    }
    247272  }
    248273}
Note: See TracChangeset for help on using the changeset viewer.