- Timestamp:
- 04/19/19 09:51:05 (6 years ago)
- Location:
- stable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
-
stable/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs
r15584 r16837 24 24 using System.ComponentModel; 25 25 using System.Drawing; 26 using System.Globalization; 26 27 using System.Linq; 27 28 using System.Windows.Forms; … … 443 444 IntValue intValue = value as IntValue; 444 445 TimeSpanValue timeSpanValue = value as TimeSpanValue; 446 DateTimeValue dateTimeValue = value as DateTimeValue; 445 447 double? ret = null; 446 448 if (doubleValue != null) { … … 451 453 else if (timeSpanValue != null) { 452 454 ret = timeSpanValue.Value.TotalSeconds; 455 } else if (dateTimeValue != null) { 456 ret = dateTimeValue.Value.ToOADate(); 453 457 } else { 454 458 int columnIndex = Matrix.ColumnNames.ToList().IndexOf(columnName); … … 531 535 int axisDimensionCount = Enum.GetNames(typeof(AxisDimension)).Count(); 532 536 int columnIndex = xAxisComboBox.SelectedIndex - axisDimensionCount; 533 if (columnIndex >= 0 && Content.GetValue(0, columnIndex) is TimeSpanValue) 534 this.chart.ChartAreas[0].CursorX.Interval = 1; 537 if (columnIndex >= 0) { 538 var value = Content.GetValue(0, columnIndex); 539 if (value is TimeSpanValue || value is DateTimeValue) 540 this.chart.ChartAreas[0].CursorX.Interval = 1; 541 } 535 542 columnIndex = yAxisComboBox.SelectedIndex - axisDimensionCount; 536 if (columnIndex >= 0 && Content.GetValue(0, columnIndex) is TimeSpanValue) 537 this.chart.ChartAreas[0].CursorY.Interval = 1; 543 if (columnIndex >= 0) { 544 var value = Content.GetValue(0, columnIndex); 545 if (value is TimeSpanValue || value is DateTimeValue) 546 this.chart.ChartAreas[0].CursorY.Interval = 1; 547 } 538 548 } 539 549 … … 734 744 axis.CustomLabels.Add(i - axis.LabelStyle.Interval / 2, i + axis.LabelStyle.Interval / 2, x); 735 745 } 746 } else if (dimension > 0 && Content.GetValue(0, dimension) is DateTimeValue) { 747 this.chart.ChartAreas[0].RecalculateAxesScale(); 748 for (double i = axis.Minimum; i <= axis.Maximum; i += axis.LabelStyle.Interval) { 749 DateTime dt = DateTime.FromOADate(i); 750 string x = dt.ToString(CultureInfo.CurrentCulture); 751 axis.CustomLabels.Add(i - axis.LabelStyle.Interval / 2, i + axis.LabelStyle.Interval / 2, x); 752 } 736 753 } 737 754 }
Note: See TracChangeset
for help on using the changeset viewer.