Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/21/16 16:48:30 (7 years ago)
Author:
pfleck
Message:

#2713 Fixed an charting issue that wrongly interprets scatterplot data if all x-values are zero.

File:
1 edited

Legend:

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

    r14493 r14516  
    508508
    509509    private void FillSeriesWithRowValues(Series series, ScatterPlotDataRow row) {
     510      bool zerosOnly = true;
    510511      for (int i = 0; i < row.Points.Count; i++) {
    511512        var value = row.Points[i];
     
    518519        }
    519520        series.Points.Add(point);
    520       }
     521        if (value.X != 0.0f)
     522          zerosOnly = false;
     523      }
     524      if (zerosOnly) // if all x-values are zero, the x-values are interpreted as 1, 2, 3, ...
     525        series.Points.Add(new DataPoint(1, 1) { IsEmpty = true });
    521526      double correlation = Correlation(row.Points);
    522527      series.LegendToolTip = string.Format("Correlation (R²) = {0:G4}", correlation * correlation);
Note: See TracChangeset for help on using the changeset viewer.