Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14508 for trunk/sources


Ignore:
Timestamp:
12/20/16 11:06:50 (7 years ago)
Author:
pfleck
Message:

#2715 Only use valid values for calculating min/max for histograms to avoid conversion errors from NaN.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableControl.cs

    r14458 r14508  
    541541      if (!row.Values.Any()) return;
    542542
     543      var validValues = histogramRows.SelectMany(r => r.Values).Where(x => !IsInvalidValue(x)).ToList();
     544      if (!validValues.Any()) return;
     545
    543546      int bins = histogramRows.Max(r => r.VisualProperties.Bins);
    544       decimal minValue = (decimal)histogramRows.Min(r => r.Values.Min());
    545       decimal maxValue = (decimal)histogramRows.Max(r => r.Values.Max());
     547      decimal minValue = (decimal)validValues.Min();
     548      decimal maxValue = (decimal)validValues.Max();
    546549      decimal intervalWidth = (maxValue - minValue) / bins;
    547550      if (intervalWidth < 0) return;
Note: See TracChangeset for help on using the changeset viewer.