Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/21/14 15:28:27 (10 years ago)
Author:
aesterer
Message:

Added scatter plot view

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

Legend:

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

    r10867 r10882  
    2727using HeuristicLab.Core;
    2828using HeuristicLab.Data;
     29using HeuristicLab.Common;
    2930
    3031namespace HeuristicLab.DataPreprocessing {
     
    6061      row.VisualProperties.ChartType = chartType;
    6162      return row;
    62     }
    63 
    64     private void ReplaceNANwithZero(IList<double> values) {
    65       for (int i = 0; i < values.Count; i++) {
    66         if (Double.IsNaN(values[i]))
    67           values[i] = 0;
    68       }
    6963    }
    7064
     
    148142    }
    149143
     144    public ScatterPlot CreateScatterPlot(string name, string variableNameX, string variableNameY) {
     145      ScatterPlot scatterPlot = new ScatterPlot(name, "");
     146     
     147
     148      List<double> xValues = GetVariableValues(variableNameX);
     149      List<double> yValues = GetVariableValues(variableNameY);
     150
     151      List<Point2D<double>> points = new List<Point2D<double>>();
     152
     153      for( int i = 0; i < xValues.Count; i++)
     154      {
     155          Point2D<double> point = new Point2D<double>(xValues[i],yValues[i]);
     156          points.Add(point);
     157      }
     158
     159      ScatterPlotDataRow scdr = new ScatterPlotDataRow(variableNameX + " - " + variableNameY,"",points);
     160      scatterPlot.Rows.Add(scdr);
     161      return scatterPlot;
     162    }
     163
    150164    #endregion
    151165  }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ScatterPlotContent.cs

    r10867 r10882  
    2626namespace HeuristicLab.DataPreprocessing {
    2727
    28   [Item("LineChart", "Represents the line chart grid.")]
    29   public class LineChartContent : PreprocessingChartContent {
     28  [Item("ScatterPlot", "Represents a scatter plot.")]
     29  public class ScatterPlotContent : PreprocessingChartContent {
    3030
    31     public LineChartContent(IChartLogic chartlogic)
     31    public ScatterPlotContent(IChartLogic chartlogic)
    3232      : base(chartlogic) {
    3333    }
    3434
    35     public LineChartContent(LineChartContent content, Cloner cloner)
     35    public ScatterPlotContent(ScatterPlotContent content, Cloner cloner)
    3636      : base(content, cloner) {
    3737
     
    4343
    4444    public override IDeepCloneable Clone(Cloner cloner) {
    45       return new LineChartContent(this, cloner);
     45      return new ScatterPlotContent(this, cloner);
    4646    }
    4747
Note: See TracChangeset for help on using the changeset viewer.