Changeset 14542 for branches/symbreg-factors-2650/HeuristicLab.Analysis.Views/3.3/ScatterPlotControl.cs
- Timestamp:
- 01/04/17 16:33:37 (7 years ago)
- Location:
- branches/symbreg-factors-2650
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/symbreg-factors-2650
- Property svn:mergeinfo changed
/trunk/sources merged: 14504,14506-14509,14516-14517,14519,14522-14523,14527-14529,14531-14533
- Property svn:mergeinfo changed
-
branches/symbreg-factors-2650/HeuristicLab.Analysis.Views
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Analysis.Views merged: 14508,14516,14519
- Property svn:mergeinfo changed
-
branches/symbreg-factors-2650/HeuristicLab.Analysis.Views/3.3/ScatterPlotControl.cs
r14498 r14542 29 29 using HeuristicLab.Collections; 30 30 using HeuristicLab.Common; 31 using HeuristicLab.MainForm.WindowsForms; 31 32 32 33 namespace HeuristicLab.Analysis.Views { 33 public partial class ScatterPlotControl : UserControl{34 public partial class ScatterPlotControl : AsynchronousContentView { 34 35 protected List<Series> invisibleSeries; 35 36 protected Dictionary<IObservableList<Point2D<double>>, ScatterPlotDataRow> pointsRowsTable; … … 37 38 private double xMin, xMax, yMin, yMax; 38 39 39 private ScatterPlot content; 40 public ScatterPlot Content { 41 get { return content; } 42 set { 43 if (value == content) return; 44 if (content != null) DeregisterContentEvents(); 45 content = value; 46 if (content != null) RegisterContentEvents(); 47 OnContentChanged(); 48 SetEnabledStateOfControls(); 49 } 40 public new ScatterPlot Content { 41 get { return (ScatterPlot)base.Content; } 42 set { base.Content = value; } 50 43 } 51 44 … … 61 54 62 55 #region Event Handler Registration 63 protected virtualvoid DeregisterContentEvents() {56 protected override void DeregisterContentEvents() { 64 57 foreach (ScatterPlotDataRow row in Content.Rows) 65 58 DeregisterScatterPlotDataRowEvents(row); … … 70 63 Content.Rows.CollectionReset -= new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_CollectionReset); 71 64 } 72 protected virtualvoid RegisterContentEvents() {65 protected override void RegisterContentEvents() { 73 66 Content.VisualPropertiesChanged += new EventHandler(Content_VisualPropertiesChanged); 74 67 Content.Rows.ItemsAdded += new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsAdded); … … 98 91 #endregion 99 92 100 protected virtualvoid OnContentChanged() {93 protected override void OnContentChanged() { 101 94 invisibleSeries.Clear(); 102 95 chart.Titles[0].Text = string.Empty; … … 114 107 } 115 108 116 protected virtualvoid SetEnabledStateOfControls() {109 protected override void SetEnabledStateOfControls() { 117 110 chart.Enabled = Content != null; 118 111 } … … 508 501 509 502 private void FillSeriesWithRowValues(Series series, ScatterPlotDataRow row) { 503 bool zerosOnly = true; 510 504 for (int i = 0; i < row.Points.Count; i++) { 511 505 var value = row.Points[i]; … … 518 512 } 519 513 series.Points.Add(point); 520 } 514 if (value.X != 0.0f) 515 zerosOnly = false; 516 } 517 if (zerosOnly) // if all x-values are zero, the x-values are interpreted as 1, 2, 3, ... 518 series.Points.Add(new DataPoint(1, 1) { IsEmpty = true }); 521 519 double correlation = Correlation(row.Points); 522 520 series.LegendToolTip = string.Format("Correlation (R²) = {0:G4}", correlation * correlation);
Note: See TracChangeset
for help on using the changeset viewer.