Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/20/18 15:29:28 (6 years ago)
Author:
fholzing
Message:

#2383: LineCharts will now show a gap instead of hiding NaN/Inf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartViewBase.cs

    r15790 r15793  
    2020#endregion
    2121using System;
    22 using System.Collections.Generic;
    2322using System.Drawing;
    2423using System.Linq;
     
    7574        var rows = Enumerable.Range(0, Content.ProblemData.Dataset.Rows).ToArray();
    7675        var targetVariables = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable).ToArray();
    77         List<int> xVals = new List<int>();
    78         List<double> yVals = new List<double>();
    79 
    80         for (int i = 0; i < rows.Length; i++) {
    81           if (!double.IsInfinity(targetVariables[i]) && !double.IsNaN(targetVariables[i])) {
    82             xVals.Add(rows[i]);
    83             yVals.Add(targetVariables[i]);
    84           }
    85         }
    86 
    87         this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindXY(xVals.ToArray(), yVals.ToArray());
     76
     77
     78        this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindXY(rows.ToArray(), targetVariables.Select(v => double.IsInfinity(v) ? double.NaN : v).ToArray());
    8879        // training series
    8980        this.chart.Series.Add(ESTIMATEDVALUES_TRAINING_SERIES_NAME);
Note: See TracChangeset for help on using the changeset viewer.