Changeset 6115 for branches/histogram/HeuristicLab.Analysis.Views/3.3
- Timestamp:
- 05/03/11 19:52:35 (13 years ago)
- Location:
- branches/histogram/HeuristicLab.Analysis.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/histogram/HeuristicLab.Analysis.Views/3.3/DataTableHistoryView.cs
r5445 r6115 27 27 [View("DataTableHistory View")] 28 28 [Content(typeof(DataTableHistory), true)] 29 public partial class DataTableHistoryView : MovieView<DataTable> {29 public partial class DataTableHistoryView : MovieView<DataTable>, IConfigureableView { 30 30 public DataTableHistoryView() { 31 31 InitializeComponent(); 32 32 itemsGroupBox.Text = "Data Table"; 33 33 } 34 35 public void ShowConfiguration() { 36 DataTable current = viewHost.Content as DataTable; 37 if (current == null) return; 38 using (DataTableVisualPropertiesDialog dialog = new DataTableVisualPropertiesDialog(current)) { 39 if (dialog.ShowDialog() != DialogResult.OK) return; 40 foreach (DataTable dt in Content) { 41 if (current != dt) { 42 dt.VisualProperties = (DataTableVisualProperties)current.VisualProperties.Clone(); 43 foreach (DataRow row in current.Rows) 44 dt.Rows[row.Name].VisualProperties = (DataRowVisualProperties)row.VisualProperties.Clone(); 45 } 46 } 47 } 48 } 49 34 50 } 35 51 } -
branches/histogram/HeuristicLab.Analysis.Views/3.3/DataTableView.cs
r6032 r6115 236 236 } 237 237 area.RecalculateAxesScale(); 238 area.AxisX.IsMarginVisible = false; 239 area.AxisX2.IsMarginVisible = false; 238 240 239 241 if (!Content.VisualProperties.XAxisMinimumAuto && !double.IsNaN(Content.VisualProperties.XAxisMinimumFixedValue)) area.AxisX.Minimum = Content.VisualProperties.XAxisMinimumFixedValue; 240 #region Workaround for bug in RecalculateAxesScale() that would assign -1241 else {242 if (area.AxisX.IsStartedFromZero243 && chart.Series.Where(x => x.XAxisType == AxisType.Primary).Any()244 && chart.Series.Where(x => x.XAxisType == AxisType.Primary).SelectMany(x => x.Points).Any()) {245 double minX = chart.Series.Where(x => x.XAxisType == AxisType.Primary).SelectMany(x => x.Points).Select(x => x.XValue).Min();246 if (minX >= 0 && area.AxisX.Minimum < 0) area.AxisX.Minimum = 0;247 }248 }249 #endregion250 242 if (!Content.VisualProperties.XAxisMaximumAuto && !double.IsNaN(Content.VisualProperties.XAxisMaximumFixedValue)) area.AxisX.Maximum = Content.VisualProperties.XAxisMaximumFixedValue; 251 243 if (!Content.VisualProperties.SecondXAxisMinimumAuto && !double.IsNaN(Content.VisualProperties.SecondXAxisMinimumFixedValue)) area.AxisX2.Minimum = Content.VisualProperties.SecondXAxisMinimumFixedValue; 252 #region Workaround for bug in RecalculateAxesScale() that would assign -1253 else {254 if (area.AxisX2.IsStartedFromZero255 && chart.Series.Where(x => x.XAxisType == AxisType.Secondary).Any()256 && chart.Series.Where(x => x.XAxisType == AxisType.Secondary).SelectMany(x => x.Points).Any()) {257 double minX2 = chart.Series.Where(x => x.XAxisType == AxisType.Secondary).SelectMany(x => x.Points).Select(x => x.XValue).Min();258 if (minX2 >= 0 && area.AxisX2.Minimum < 0) area.AxisX2.Minimum = 0;259 }260 }261 #endregion262 244 if (!Content.VisualProperties.SecondXAxisMaximumAuto && !double.IsNaN(Content.VisualProperties.SecondXAxisMaximumFixedValue)) area.AxisX2.Maximum = Content.VisualProperties.SecondXAxisMaximumFixedValue; 263 245 if (!Content.VisualProperties.YAxisMinimumAuto && !double.IsNaN(Content.VisualProperties.YAxisMinimumFixedValue)) area.AxisY.Minimum = Content.VisualProperties.YAxisMinimumFixedValue; … … 575 557 double maxValue = row.Values.Max(); 576 558 double intervalWidth = (maxValue - minValue) / bins; 577 if (intervalWidth <= 0) return; 559 if (intervalWidth < 0) return; 560 if (intervalWidth == 0) { 561 series.Points.AddXY(minValue, row.Values.Count); 562 return; 563 } 578 564 579 565 if (!row.VisualProperties.ExactBins) { … … 585 571 double current = minValue, intervalCenter = intervalWidth / 2.0; 586 572 int frequency = 0; 573 series.Points.AddXY(current - intervalCenter, 0); // so that the first column is not visually truncated 587 574 foreach (double v in row.Values.Where(x => !IsInvalidValue(x)).OrderBy(x => x)) { 588 575 while (v > current + intervalWidth) { … … 594 581 } 595 582 series.Points.AddXY(current + intervalCenter, frequency); 583 series.Points.AddXY(current + 3 * intervalCenter, 0); // so that the last column is not visually truncated 596 584 } 597 585
Note: See TracChangeset
for help on using the changeset viewer.