Changeset 3530


Ignore:
Timestamp:
04/26/10 09:29:18 (12 years ago)
Author:
gkronber
Message:

Checked for invalid values in all series manipulating operations and changed the legend to dock at the top. #920 (Each single objective problem should provide a parameter for its best known quality)

Location:
trunk/sources/HeuristicLab.Analysis.Views/3.3
Files:
2 edited

Legend:

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

    r2917 r3530  
    7676      chartArea1.Name = "ChartArea1";
    7777      this.chart.ChartAreas.Add(chartArea1);
     78      legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
    7879      legend1.Name = "Legend1";
    7980      this.chart.Legends.Add(legend1);
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableView.cs

    r3495 r3530  
    120120      for (int i = 0; i < row.Values.Count; i++) {
    121121        var value = row.Values[i];
    122         if (double.IsNaN(value) || value < (double)decimal.MinValue || value > (double)decimal.MaxValue) {
     122        if (IsInvalidValue(value)) {
    123123          DataPoint point = new DataPoint();
    124124          point.IsEmpty = true;
     
    225225        foreach (IndexedItem<double> item in e.Items) {
    226226          var value = item.Value;
    227           if (double.IsNaN(value) || value < (double)decimal.MinValue || value > (double)decimal.MaxValue) {
     227          if (IsInvalidValue(item.Value)) {
    228228            DataPoint point = new DataPoint();
    229229            point.IsEmpty = true;
     
    253253        DataRow row = valuesRowsTable[(IObservableList<double>)sender];
    254254        foreach (IndexedItem<double> item in e.Items) {
    255           if (double.IsNaN(item.Value))
     255          if (IsInvalidValue(item.Value))
    256256            chart.Series[row.Name].Points[item.Index].IsEmpty = true;
    257           else
     257          else {
    258258            chart.Series[row.Name].Points[item.Index].YValues = new double[] { item.Value };
     259            chart.Series[row.Name].Points[item.Index].IsEmpty = false;
     260          }
    259261        }
    260262      }
     
    266268        DataRow row = valuesRowsTable[(IObservableList<double>)sender];
    267269        foreach (IndexedItem<double> item in e.Items) {
    268           if (double.IsNaN(item.Value))
     270          if (IsInvalidValue(item.Value))
    269271            chart.Series[row.Name].Points[item.Index].IsEmpty = true;
    270           else
     272          else {
    271273            chart.Series[row.Name].Points[item.Index].YValues = new double[] { item.Value };
    272         }
    273       }
    274     }
     274            chart.Series[row.Name].Points[item.Index].IsEmpty = false;
     275          }
     276        }
     277      }
     278    }
     279
    275280    private void Values_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<double>> e) {
    276281      if (InvokeRequired)
     
    280285        chart.Series[row.Name].Points.Clear();
    281286        foreach (IndexedItem<double> item in e.Items) {
    282           if (double.IsNaN(item.Value))
     287          if (IsInvalidValue(item.Value))
    283288            chart.Series[row.Name].Points[item.Index].IsEmpty = true;
    284           else
     289          else {
    285290            chart.Series[row.Name].Points[item.Index].YValues = new double[] { item.Value };
     291            chart.Series[row.Name].Points[item.Index].IsEmpty = false;
     292          }
    286293        }
    287294      }
    288295    }
    289296    #endregion
     297
     298    private bool IsInvalidValue(double x) {
     299      return double.IsNaN(x) || x < (double)decimal.MinValue || x > (double)decimal.MaxValue;
     300    }
    290301  }
    291302}
Note: See TracChangeset for help on using the changeset viewer.