Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/09/14 13:05:38 (10 years ago)
Author:
aesterer
Message:

Update chart when data changed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ChartLogic.cs

    r10733 r10736  
    3838    public DataRow CreateDataRow(string variableName, DataRowVisualProperties.DataRowChartType chartType) {
    3939      IList<double> values = preprocessingData.GetValues<double>(variableName);
     40
     41      //TODO: handle NAN values correctly
     42      // CalculateHistogram in DataTableView fails with NAN values ( Min(), Max() returns NAN)
     43      ReplayNANwithZero(values);
    4044      DataRow row = new DataRow(variableName, "", values);
    4145      row.VisualProperties.ChartType = chartType;
    4246      return row;
    4347    }
     48
     49    private void ReplayNANwithZero(IList<double> values) {
     50      for (int i = 0; i < values.Count; i++) {
     51        if (Double.IsNaN(values[i]))
     52          values[i] = 0;
     53      }
     54    }
     55
     56
    4457
    4558    private IEnumerable<string> GetVariableNames() {
Note: See TracChangeset for help on using the changeset viewer.