Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/03/11 19:52:35 (13 years ago)
Author:
abeham
Message:

#1465

  • Added new interface IConfigureableView to HeuristicLab.MainForm
  • Adapted ViewHost to show a configuration button when its ActiveView is of type IConfigureableView
  • Changed DataTableHistoryView to be an IConfigureableView
  • When changing the configuration of a history view the configuration will be applied to every frame
  • Fixed a bug in calculating the histogram (when all values were the same)
  • Added preceeding and trailing 0-bar in the histogram to prevent cutting the first and last column in the view
  • Added a method Replace(IEnumerable<T>) to the ObservableList to do Clear() and AddRange() with just a single event notification
    • Calling that method from the QualityDistributionAnalyzer (otherwise the result view is flickering)
  • Fixing a bug regarding axis labels in the QualityDistributionAnalyzer
  • Removed double AfterDeserializationHook in QAP
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/histogram/HeuristicLab.Analysis.Views/3.3/DataTableView.cs

    r6032 r6115  
    236236      }
    237237      area.RecalculateAxesScale();
     238      area.AxisX.IsMarginVisible = false;
     239      area.AxisX2.IsMarginVisible = false;
    238240
    239241      if (!Content.VisualProperties.XAxisMinimumAuto && !double.IsNaN(Content.VisualProperties.XAxisMinimumFixedValue)) area.AxisX.Minimum = Content.VisualProperties.XAxisMinimumFixedValue;
    240       #region Workaround for bug in RecalculateAxesScale() that would assign -1
    241       else {
    242         if (area.AxisX.IsStartedFromZero
    243         && chart.Series.Where(x => x.XAxisType == AxisType.Primary).Any()
    244         && chart.Series.Where(x => x.XAxisType == AxisType.Primary).SelectMany(x => x.Points).Any()) {
    245           double minX = chart.Series.Where(x => x.XAxisType == AxisType.Primary).SelectMany(x => x.Points).Select(x => x.XValue).Min();
    246           if (minX >= 0 && area.AxisX.Minimum < 0) area.AxisX.Minimum = 0;
    247         }
    248       }
    249       #endregion
    250242      if (!Content.VisualProperties.XAxisMaximumAuto && !double.IsNaN(Content.VisualProperties.XAxisMaximumFixedValue)) area.AxisX.Maximum = Content.VisualProperties.XAxisMaximumFixedValue;
    251243      if (!Content.VisualProperties.SecondXAxisMinimumAuto && !double.IsNaN(Content.VisualProperties.SecondXAxisMinimumFixedValue)) area.AxisX2.Minimum = Content.VisualProperties.SecondXAxisMinimumFixedValue;
    252       #region Workaround for bug in RecalculateAxesScale() that would assign -1
    253       else {
    254         if (area.AxisX2.IsStartedFromZero
    255          && chart.Series.Where(x => x.XAxisType == AxisType.Secondary).Any()
    256          && chart.Series.Where(x => x.XAxisType == AxisType.Secondary).SelectMany(x => x.Points).Any()) {
    257           double minX2 = chart.Series.Where(x => x.XAxisType == AxisType.Secondary).SelectMany(x => x.Points).Select(x => x.XValue).Min();
    258           if (minX2 >= 0 && area.AxisX2.Minimum < 0) area.AxisX2.Minimum = 0;
    259         }
    260       }
    261       #endregion
    262244      if (!Content.VisualProperties.SecondXAxisMaximumAuto && !double.IsNaN(Content.VisualProperties.SecondXAxisMaximumFixedValue)) area.AxisX2.Maximum = Content.VisualProperties.SecondXAxisMaximumFixedValue;
    263245      if (!Content.VisualProperties.YAxisMinimumAuto && !double.IsNaN(Content.VisualProperties.YAxisMinimumFixedValue)) area.AxisY.Minimum = Content.VisualProperties.YAxisMinimumFixedValue;
     
    575557      double maxValue = row.Values.Max();
    576558      double intervalWidth = (maxValue - minValue) / bins;
    577       if (intervalWidth <= 0) return;
     559      if (intervalWidth < 0) return;
     560      if (intervalWidth == 0) {
     561        series.Points.AddXY(minValue, row.Values.Count);
     562        return;
     563      }
    578564
    579565      if (!row.VisualProperties.ExactBins) {
     
    585571      double current = minValue, intervalCenter = intervalWidth / 2.0;
    586572      int frequency = 0;
     573      series.Points.AddXY(current - intervalCenter, 0); // so that the first column is not visually truncated
    587574      foreach (double v in row.Values.Where(x => !IsInvalidValue(x)).OrderBy(x => x)) {
    588575        while (v > current + intervalWidth) {
     
    594581      }
    595582      series.Points.AddXY(current + intervalCenter, frequency);
     583      series.Points.AddXY(current + 3 * intervalCenter, 0); // so that the last column is not visually truncated
    596584    }
    597585
Note: See TracChangeset for help on using the changeset viewer.