Free cookie consent management tool by TermsFeed Policy Generator

Changeset 16837 for stable


Ignore:
Timestamp:
04/19/19 09:51:05 (6 years ago)
Author:
gkronber
Message:

#2995: merged r16681 from trunk to stable

Location:
stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs

    r15584 r16837  
    2424using System.ComponentModel;
    2525using System.Drawing;
     26using System.Globalization;
    2627using System.Linq;
    2728using System.Windows.Forms;
     
    443444        IntValue intValue = value as IntValue;
    444445        TimeSpanValue timeSpanValue = value as TimeSpanValue;
     446        DateTimeValue dateTimeValue = value as DateTimeValue;
    445447        double? ret = null;
    446448        if (doubleValue != null) {
     
    451453        else if (timeSpanValue != null) {
    452454          ret = timeSpanValue.Value.TotalSeconds;
     455        } else if (dateTimeValue != null) {
     456          ret = dateTimeValue.Value.ToOADate();
    453457        } else {
    454458          int columnIndex = Matrix.ColumnNames.ToList().IndexOf(columnName);
     
    531535      int axisDimensionCount = Enum.GetNames(typeof(AxisDimension)).Count();
    532536      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      }
    535542      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      }
    538548    }
    539549
     
    734744          axis.CustomLabels.Add(i - axis.LabelStyle.Interval / 2, i + axis.LabelStyle.Interval / 2, x);
    735745        }
     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        }
    736753      }
    737754    }
Note: See TracChangeset for help on using the changeset viewer.