Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/16/16 14:47:38 (8 years ago)
Author:
pfleck
Message:

#2709

  • Fixed initial point size for scatterplots.
  • Reuse the visual properties of the old data row if a single variable is changed in the ScatterPlotSingleView
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/ScatterPlotContent.cs

    r14474 r14495  
    4242      ScatterPlot scatterPlot = new ScatterPlot();
    4343
    44       IList<double> xValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameX));
    45       IList<double> yValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameY));
     44      IList<double> xValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameX)).Where(x => !double.IsNaN(x) && !double.IsInfinity(x)).ToList();
     45      IList<double> yValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameY)).Where(x => !double.IsNaN(x) && !double.IsInfinity(x)).ToList();
    4646
    47       double axisMin, axisMax, axisInterval;
    48       try {
    49         ChartUtil.CalculateOptimalAxisInterval(xValues.Min(), xValues.Max(), out axisMin, out axisMax, out axisInterval);
    50         scatterPlot.VisualProperties.XAxisMinimumAuto = false;
    51         scatterPlot.VisualProperties.XAxisMaximumAuto = false;
    52         scatterPlot.VisualProperties.XAxisMinimumFixedValue = axisMin;
    53         scatterPlot.VisualProperties.XAxisMaximumFixedValue = axisMax;
    54       } catch (ArgumentOutOfRangeException) { } // missing values lead to NaNs
    55       try {
    56         ChartUtil.CalculateOptimalAxisInterval(yValues.Min(), yValues.Max(), out axisMin, out axisMax, out axisInterval);
    57         scatterPlot.VisualProperties.YAxisMinimumAuto = false;
    58         scatterPlot.VisualProperties.YAxisMaximumAuto = false;
    59         scatterPlot.VisualProperties.YAxisMinimumFixedValue = axisMin;
    60         scatterPlot.VisualProperties.YAxisMaximumFixedValue = axisMax;
    61       } catch (ArgumentOutOfRangeException) { } // missing values lead to NaNs
     47      if (xValues.Any()) {
     48        try {
     49          double axisMin, axisMax, axisInterval;
     50          ChartUtil.CalculateOptimalAxisInterval(xValues.Min(), xValues.Max(), out axisMin, out axisMax, out axisInterval);
     51          scatterPlot.VisualProperties.XAxisMinimumAuto = false;
     52          scatterPlot.VisualProperties.XAxisMaximumAuto = false;
     53          scatterPlot.VisualProperties.XAxisMinimumFixedValue = axisMin;
     54          scatterPlot.VisualProperties.XAxisMaximumFixedValue = axisMax;
     55        } catch (ArgumentOutOfRangeException) { } // error during CalculateOptimalAxisInterval
     56      }
     57      if (yValues.Any()) {
     58        try {
     59          double axisMin, axisMax, axisInterval;
     60          ChartUtil.CalculateOptimalAxisInterval(yValues.Min(), yValues.Max(), out axisMin, out axisMax, out axisInterval);
     61          scatterPlot.VisualProperties.YAxisMinimumAuto = false;
     62          scatterPlot.VisualProperties.YAxisMaximumAuto = false;
     63          scatterPlot.VisualProperties.YAxisMinimumFixedValue = axisMin;
     64          scatterPlot.VisualProperties.YAxisMaximumFixedValue = axisMax;
     65        } catch (ArgumentOutOfRangeException) { } // error during CalculateOptimalAxisInterval
     66      }
    6267
    6368      if (variableNameGroup == null || variableNameGroup == "-") {
     
    6974        }
    7075
    71         ScatterPlotDataRow scdr = new ScatterPlotDataRow(variableNameX + " - " + variableNameY, "", points) {
    72           VisualProperties = { PointSize = 6 }
    73         };
     76        ScatterPlotDataRow scdr = new ScatterPlotDataRow(variableNameX + " - " + variableNameY, "", points);
    7477        scdr.VisualProperties.IsVisibleInLegend = false;
    7578        scatterPlot.Rows.Add(scdr);
Note: See TracChangeset for help on using the changeset viewer.