Changeset 13836 for branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/GradientChart.cs
- Timestamp:
- 05/04/16 17:17:08 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/GradientChart.cs
r13831 r13836 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Drawing; 24 25 using System.Globalization; 25 26 using System.Linq; … … 27 28 using System.Windows.Forms.DataVisualization.Charting; 28 29 using HeuristicLab.Common; 30 using HeuristicLab.MainForm.WindowsForms; 29 31 using HeuristicLab.Visualization.ChartControlsExtensions; 30 32 … … 110 112 public GradientChart() { 111 113 InitializeComponent(); 114 115 // Configure axis 116 chart.CustomizeAllChartAreas(); 117 chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true; 118 chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true; 119 chart.ChartAreas[0].CursorX.Interval = 0; 120 121 chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true; 122 chart.ChartAreas[0].AxisY.ScaleView.Zoomable = true; 123 chart.ChartAreas[0].CursorY.Interval = 0; 112 124 } 113 125 … … 187 199 axis.Interval = axisInterval; 188 200 189 // Create series 190 chart.Series.Clear();201 // Create series <mean, conf. interval> 202 var seriesDict = new Dictionary<Series, Series>(); 191 203 for (int i = 0; i < solutions.Count; ++i) { 192 204 var solution = solutions[i]; 193 205 Series confidenceIntervalPlotSeries; 194 var series = CreateSeries(solution, out confidenceIntervalPlotSeries); 195 series.Name = Solutions.First().ProblemData.TargetVariable + " " + i; 206 var meanSeries = CreateSeries(solution, out confidenceIntervalPlotSeries); 207 meanSeries.Name = Solutions.First().ProblemData.TargetVariable + " " + i; 208 seriesDict.Add(meanSeries, confidenceIntervalPlotSeries); 196 209 if (confidenceIntervalPlotSeries != null) 197 chart.Series.Add(confidenceIntervalPlotSeries); 210 confidenceIntervalPlotSeries.Name = "95% Conf. Interval " + meanSeries.Name; 211 } 212 213 chart.SuspendRepaint(); 214 chart.Series.Clear(); 215 // Add mean series for applying palette colors 216 foreach (var series in seriesDict.Keys) { 217 series.LegendText = series.Name; 198 218 chart.Series.Add(series); 199 219 } 220 chart.Palette = ChartColorPalette.BrightPastel; 221 chart.ApplyPaletteColors(); 222 chart.Palette = ChartColorPalette.None; 223 224 foreach (var series in seriesDict) { 225 if (series.Value == null) continue; 226 int idx = chart.Series.IndexOf(series.Key); 227 series.Value.Color = Color.FromArgb(40, series.Key.Color); 228 series.Value.IsVisibleInLegend = false; 229 chart.Series.Insert(idx, series.Value); 230 } 231 chart.ResumeRepaint(true); 232 233 200 234 //// calculate Y-axis interval 201 235 //double ymin = 0, ymax = 0;
Note: See TracChangeset
for help on using the changeset viewer.