Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/07/14 10:44:11 (11 years ago)
Author:
aesterer
Message:

Added coloring selection feature to line chart

Location:
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations
Files:
1 added
1 edited

Legend:

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

    r10736 r10803  
    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);
    4440      DataRow row = new DataRow(variableName, "", values);
    4541      row.VisualProperties.ChartType = chartType;
     
    4743    }
    4844
    49     private void ReplayNANwithZero(IList<double> values) {
     45    public DataRow CreateDataRowRange(string variableName,int start, int end, DataRowVisualProperties.DataRowChartType chartType) {
     46      IList<double> values = preprocessingData.GetValues<double>(variableName);
     47      IList<double> valuesRange = new List<double>();
     48      for (int i = 0; i < values.Count; i++) {
     49        if (i >= start && i <= end)
     50          valuesRange.Add(values[i]);
     51        else
     52          valuesRange.Add(Double.NaN);
     53      }
     54
     55      DataRow row = new DataRow(variableName, "", valuesRange);
     56      row.VisualProperties.ChartType = chartType;
     57      return row;
     58    }
     59
     60    private void ReplaceNANwithZero(IList<double> values) {
    5061      for (int i = 0; i < values.Count; i++) {
    5162        if (Double.IsNaN(values[i]))
Note: See TracChangeset for help on using the changeset viewer.