Changeset 15097 for stable/HeuristicLab.Analysis.Views/3.3/DataTableView.cs
- Timestamp:
- 06/30/17 16:41:06 (7 years ago)
- Location:
- stable
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 14435-14439,14457-14458,14493,14508,14516,14519,14582,14740,14860-14861,14982,14984,14987,14992,15042,15068,15095
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Analysis.Views
-
stable/HeuristicLab.Analysis.Views/3.3/DataTableView.cs
r14982 r15097 36 36 protected List<Series> invisibleSeries; 37 37 protected Dictionary<IObservableList<double>, DataRow> valuesRowsTable; 38 protected bool showChartOnly = false; 38 39 39 40 public new DataTable Content { … … 42 43 } 43 44 44 public bool Show Name{45 get { return nameTextBox.Visible; }45 public bool ShowChartOnly { 46 get { return showChartOnly; } 46 47 set { 47 if (nameTextBox.Visible != value) { 48 foreach (Control c in Controls) { 49 if (c == chart) continue; 50 c.Visible = value; 51 } 52 chart.Dock = value ? DockStyle.None : DockStyle.Fill; 48 if (showChartOnly != value) { 49 showChartOnly = value; 50 UpdateControlsVisibility(); 53 51 } 54 52 } … … 133 131 } else MessageBox.Show("Nothing to configure."); 134 132 } 133 134 protected void UpdateControlsVisibility() { 135 if (InvokeRequired) 136 Invoke(new Action(UpdateControlsVisibility)); 137 else { 138 foreach (Control c in Controls) { 139 if (c == chart) continue; 140 c.Visible = !showChartOnly; 141 } 142 chart.Dock = showChartOnly ? DockStyle.Fill : DockStyle.None; 143 } 144 } 145 135 146 protected virtual void AddDataRows(IEnumerable<DataRow> rows) { 136 147 foreach (var row in rows) { … … 195 206 break; 196 207 case DataRowVisualProperties.DataRowChartType.Histogram: 197 bool stacked = row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.Stacked;208 bool stacked = Content.VisualProperties.HistogramAggregation == DataTableVisualProperties.DataTableHistogramAggregation.Stacked; 198 209 series.ChartType = stacked ? SeriesChartType.StackedColumn : SeriesChartType.Column; 199 bool sideBySide = row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.SideBySide;210 bool sideBySide = Content.VisualProperties.HistogramAggregation == DataTableVisualProperties.DataTableHistogramAggregation.SideBySide; 200 211 series.SetCustomProperty("DrawSideBySide", sideBySide ? "True" : "False"); 201 212 series.SetCustomProperty("PointWidth", "1"); … … 319 330 private bool RequiresTransparency(DataRow row) { 320 331 return row.VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Histogram 321 && row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.Overlapping;332 && Content.VisualProperties.HistogramAggregation == DataTableVisualProperties.DataTableHistogramAggregation.Overlapping; 322 333 } 323 334 … … 338 349 ConfigureChartArea(chart.ChartAreas[0]); 339 350 RecalculateAxesScale(chart.ChartAreas[0]); // axes min/max could have changed 351 352 chart.Update(); // side-by-side and stacked histograms are not always correctly displayed without an update 353 // (chart update is required before the series are updated, otherwise the widths of the bars are updated incorrectly) 354 foreach (var row in Content.Rows.Where(r => r.VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Histogram)) 355 Row_VisualPropertiesChanged(row, EventArgs.Empty); // Histogram properties could have changed 340 356 } 341 357 } … … 551 567 switch (row.VisualProperties.ChartType) { 552 568 case DataRowVisualProperties.DataRowChartType.Histogram: 553 // when a single histogram is updated, all histograms must be updated. otherwise the value ranges and bin sizesmay not be equal.569 // when a single histogram is updated, all histograms must be updated. otherwise the value ranges may not be equal. 554 570 var histograms = Content.Rows 555 571 .Where(r => r.VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Histogram) … … 595 611 if (!validValues.Any()) return; 596 612 597 int bins = histogramRows.Max(r => r.VisualProperties.Bins);613 int bins = Content.VisualProperties.HistogramBins; 598 614 decimal minValue = (decimal)validValues.Min(); 599 615 decimal maxValue = (decimal)validValues.Max(); … … 605 621 } 606 622 607 if (! histogramRows.Any(r => r.VisualProperties.ExactBins)) {623 if (!Content.VisualProperties.HistogramExactBins) { 608 624 intervalWidth = (decimal)HumanRoundRange((double)intervalWidth); 609 625 minValue = Math.Floor(minValue / intervalWidth) * intervalWidth;
Note: See TracChangeset
for help on using the changeset viewer.