Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/05/12 11:58:17 (12 years ago)
Author:
mkommend
Message:

#1081: Merged trunk changes and fixed compilation errors due to the merge.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartView.cs

    r8430 r8742  
    8989        this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].LegendText = ESTIMATEDVALUES_ALL_SERIES_NAME;
    9090        this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].ChartType = SeriesChartType.FastLine;
    91         this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].Points.DataBindXY(allIndices, allEstimatedValues);
    92         this.InsertEmptyPoints(this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME]);
     91        if (allEstimatedValues.Count > 0) {
     92          this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].Points.DataBindXY(allIndices, allEstimatedValues);
     93          this.InsertEmptyPoints(this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME]);
     94        }
    9395        this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].Tag = Content;
    9496        this.ToggleSeriesData(this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME]);
     
    224226
    225227        IEnumerable<int> indices = null;
    226         IEnumerable<double> predictedValues = null;
     228        double[] predictedValues = null;
    227229        switch (series.Name) {
    228230          case ESTIMATEDVALUES_ALL_SERIES_NAME:
    229231            indices = Enumerable.Range(0, Content.ProblemData.Dataset.Rows).Except(Content.ProblemData.TrainingIndices).Except(Content.ProblemData.TestIndices).ToArray();
    230232            var estimatedValues = Content.EstimatedValues.ToArray();
    231             predictedValues = indices.Select(index => estimatedValues[index]).ToList();
     233            predictedValues = indices.Select(index => estimatedValues[index]).ToArray();
    232234            break;
    233235          case ESTIMATEDVALUES_TRAINING_SERIES_NAME:
     
    240242            break;
    241243        }
    242         series.Points.DataBindXY(indices, predictedValues);
    243         this.InsertEmptyPoints(series);
     244        if (predictedValues.Length > 0) {
     245          series.Points.DataBindXY(indices, predictedValues);
     246          this.InsertEmptyPoints(series);
     247        }
    244248        chart.Legends[series.Legend].ForeColor = Color.Black;
    245249        UpdateCursorInterval();
Note: See TracChangeset for help on using the changeset viewer.