Changeset 6784 for branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionScatterPlotView.cs
- Timestamp:
- 09/16/11 12:00:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionScatterPlotView.cs
r6647 r6784 130 130 if (this.chart.Series[ALL_SERIES].Points.Count > 0) 131 131 this.chart.Series[ALL_SERIES].Points.DataBindXY(Content.EstimatedValues.ToArray(), "", 132 dataset.Get VariableValues(targetVariableName), "");132 dataset.GetDoubleValues(targetVariableName).ToArray(), ""); 133 133 if (this.chart.Series[TRAINING_SERIES].Points.Count > 0) 134 134 this.chart.Series[TRAINING_SERIES].Points.DataBindXY(Content.EstimatedTrainingValues.ToArray(), "", 135 dataset.Get EnumeratedVariableValues(targetVariableName, Content.ProblemData.TrainingIndizes).ToArray(), "");135 dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TrainingIndizes).ToArray(), ""); 136 136 if (this.chart.Series[TEST_SERIES].Points.Count > 0) 137 137 this.chart.Series[TEST_SERIES].Points.DataBindXY(Content.EstimatedTestValues.ToArray(), "", 138 dataset.Get EnumeratedVariableValues(targetVariableName, Content.ProblemData.TestIndizes).ToArray(), "");139 140 double max = Content.EstimatedTrainingValues.Concat(Content.EstimatedTestValues.Concat(Content.EstimatedValues.Concat(dataset.Get VariableValues(targetVariableName)))).Max();141 double min = Content.EstimatedTrainingValues.Concat(Content.EstimatedTestValues.Concat(Content.EstimatedValues.Concat(dataset.Get VariableValues(targetVariableName)))).Min();138 dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TestIndizes).ToArray(), ""); 139 140 double max = Content.EstimatedTrainingValues.Concat(Content.EstimatedTestValues.Concat(Content.EstimatedValues.Concat(dataset.GetDoubleValues(targetVariableName)))).Max(); 141 double min = Content.EstimatedTrainingValues.Concat(Content.EstimatedTestValues.Concat(Content.EstimatedValues.Concat(dataset.GetDoubleValues(targetVariableName)))).Min(); 142 142 143 143 max = max + 0.2 * Math.Abs(max); … … 177 177 case ALL_SERIES: 178 178 predictedValues = Content.EstimatedValues.ToArray(); 179 targetValues = Content.ProblemData.Dataset.Get VariableValues(targetVariableName);179 targetValues = Content.ProblemData.Dataset.GetDoubleValues(targetVariableName).ToArray(); 180 180 break; 181 181 case TRAINING_SERIES: 182 182 predictedValues = Content.EstimatedTrainingValues.ToArray(); 183 targetValues = Content.ProblemData.Dataset.Get EnumeratedVariableValues(targetVariableName, Content.ProblemData.TrainingIndizes).ToArray();183 targetValues = Content.ProblemData.Dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TrainingIndizes).ToArray(); 184 184 break; 185 185 case TEST_SERIES: 186 186 predictedValues = Content.EstimatedTestValues.ToArray(); 187 targetValues = Content.ProblemData.Dataset.Get EnumeratedVariableValues(targetVariableName, Content.ProblemData.TestIndizes).ToArray();187 targetValues = Content.ProblemData.Dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TestIndizes).ToArray(); 188 188 break; 189 189 } … … 219 219 e.LegendItems[2].Cells[1].ForeColor = this.chart.Series[TEST_SERIES].Points.Count == 0 ? Color.Gray : Color.Black; 220 220 } 221 222 private void chart_PostPaint(object sender, ChartPaintEventArgs e) { 223 var chartArea = e.ChartElement as ChartArea; 224 if (chartArea != null) { 225 ChartGraphics chartGraphics = e.ChartGraphics; 226 using (Pen p = new Pen(Color.DarkGray)) { 227 double xmin = chartArea.AxisX.ScaleView.ViewMinimum; 228 double xmax = chartArea.AxisX.ScaleView.ViewMaximum; 229 double ymin = chartArea.AxisY.ScaleView.ViewMinimum; 230 double ymax = chartArea.AxisY.ScaleView.ViewMaximum; 231 232 if (xmin > ymax || ymin > xmax) return; 233 234 PointF start = PointF.Empty; 235 start.X = (float)chartGraphics.GetPositionFromAxis(chartArea.Name, chartArea.AxisX.AxisName, Math.Max(xmin, ymin)); 236 start.Y = (float)chartGraphics.GetPositionFromAxis(chartArea.Name, chartArea.AxisY.AxisName, Math.Max(xmin, ymin)); 237 PointF end = PointF.Empty; 238 end.X = (float)chartGraphics.GetPositionFromAxis(chartArea.Name, chartArea.AxisX.AxisName, Math.Min(xmax, ymax)); 239 end.Y = (float)chartGraphics.GetPositionFromAxis(chartArea.Name, chartArea.AxisY.AxisName, Math.Min(xmax, ymax)); 240 241 chartGraphics.Graphics.DrawLine(p, chartGraphics.GetAbsolutePoint(start), chartGraphics.GetAbsolutePoint(end)); 242 } 243 } 244 } 221 245 } 222 246 }
Note: See TracChangeset
for help on using the changeset viewer.