Changeset 13836
- Timestamp:
- 05/04/16 17:17:08 (8 years ago)
- Location:
- branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/GradientChart.Designer.cs
r13831 r13836 55 55 legend1.Alignment = System.Drawing.StringAlignment.Center; 56 56 legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top; 57 legend1.LegendItemOrder = System.Windows.Forms.DataVisualization.Charting.LegendItemOrder.SameAsSeriesOrder; 57 legend1.LegendItemOrder = System.Windows.Forms.DataVisualization.Charting.LegendItemOrder.ReversedSeriesOrder; 58 legend1.LegendStyle = System.Windows.Forms.DataVisualization.Charting.LegendStyle.Row; 58 59 legend1.Name = "Default"; 59 60 this.chart.Legends.Add(legend1); 60 61 this.chart.Location = new System.Drawing.Point(0, 0); 61 62 this.chart.Name = "chart"; 62 this.chart.PaletteCustomColors = new System.Drawing.Color[] {63 System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(180)))), ((int)(((byte)(65))))),64 System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(140)))), ((int)(((byte)(240)))))};65 63 this.chart.Size = new System.Drawing.Size(453, 308); 66 64 this.chart.TabIndex = 0; -
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; -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/RegressionSolutionGradientView.cs
r13831 r13836 33 33 [View("Gradient View")] 34 34 [Content(typeof(IConfidenceBoundRegressionSolution))] 35 public partial class RegressionSolutionGradientView 36 : DataAnalysisSolutionEvaluationView { 37 35 public partial class RegressionSolutionGradientView : DataAnalysisSolutionEvaluationView { 38 36 private const int DrawingSteps = 1000; 39 40 private const string EstimatedMeanSeriesName = "Estimated Mean";41 private const string EstimatedVarianceSeriesName = "95% Conficence Interval";42 37 43 38 private readonly List<string> variableNames;
Note: See TracChangeset
for help on using the changeset viewer.