- Timestamp:
- 07/17/17 22:02:39 (7 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 15264-15266
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization.Views
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Optimization.Views merged: 15264-15266
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs
r15161 r15267 435 435 return GetValue(run, sizeDimension); 436 436 } else { 437 int columnIndex = Matrix.ColumnNames.ToList().IndexOf(columnName); 438 IItem value = Content.GetValue(run, column Index);437 438 IItem value = Content.GetValue(run, columnName); 439 439 if (value == null) 440 440 return null; … … 451 451 else if (timeSpanValue != null) { 452 452 ret = timeSpanValue.Value.TotalSeconds; 453 } else 453 } else { 454 int columnIndex = Matrix.ColumnNames.ToList().IndexOf(columnName); 454 455 ret = GetCategoricalValue(columnIndex, value.ToString()); 456 } 455 457 456 458 return ret; … … 622 624 tooltip = run.Name + System.Environment.NewLine; 623 625 624 double? xValue = this.GetValue(run, (string)xAxisComboBox.SelectedItem); 625 double? yValue = this.GetValue(run, (string)yAxisComboBox.SelectedItem); 626 double? sizeValue = this.GetValue(run, (string)sizeComboBox.SelectedItem); 627 628 string xString = xValue == null ? string.Empty : xValue.Value.ToString(); 629 string yString = yValue == null ? string.Empty : yValue.Value.ToString(); 630 string sizeString = sizeValue == null ? string.Empty : sizeValue.Value.ToString(); 631 632 //code to handle TimeSpanValues correct 633 int axisDimensionCount = Enum.GetNames(typeof(AxisDimension)).Count(); 634 int columnIndex = xAxisComboBox.SelectedIndex - axisDimensionCount; 635 if (xValue.HasValue && columnIndex > 0 && Content.GetValue(0, columnIndex) is TimeSpanValue) { 636 TimeSpan time = TimeSpan.FromSeconds(xValue.Value); 637 xString = string.Format("{0:00}:{1:00}:{2:00.00}", (int)time.TotalHours, time.Minutes, time.Seconds); 638 } 639 columnIndex = yAxisComboBox.SelectedIndex - axisDimensionCount; 640 if (yValue.HasValue && columnIndex > 0 && Content.GetValue(0, columnIndex) is TimeSpanValue) { 641 TimeSpan time = TimeSpan.FromSeconds(yValue.Value); 642 yString = string.Format("{0:00}:{1:00}:{2:00.00}", (int)time.TotalHours, time.Minutes, time.Seconds); 643 } 626 string xString = GetTooltipValue(run, (string)xAxisComboBox.SelectedItem); 627 string yString = GetTooltipValue(run, (string)yAxisComboBox.SelectedItem); 628 string sizeString = GetTooltipValue(run, (string)sizeComboBox.SelectedItem); 644 629 645 630 tooltip += xAxisComboBox.SelectedItem + " : " + xString + Environment.NewLine; … … 648 633 649 634 return tooltip; 635 } 636 637 private string GetTooltipValue(IRun run, string columnName) { 638 if (columnName == SizeDimension.Constant.ToString()) 639 return string.Empty; 640 641 int columnIndex = Matrix.ColumnNames.ToList().IndexOf(columnName); 642 643 //handle non-numeric values correctly 644 if (categoricalMapping.ContainsKey(columnIndex)) { 645 return Content.GetValue(run, columnName).ToString(); 646 } 647 648 double? value = GetValue(run, columnName); 649 if (!value.HasValue) return string.Empty; 650 651 string valueString = value.Value.ToString(); 652 653 //code to handle TimeSpanValues correctly 654 if (columnIndex > 0 && Content.GetValue(0, columnIndex) is TimeSpanValue) { 655 TimeSpan time = TimeSpan.FromSeconds(value.Value); 656 valueString = string.Format("{0:00}:{1:00}:{2:00.00}", (int)time.TotalHours, time.Minutes, time.Seconds); 657 } 658 659 return valueString; 650 660 } 651 661 #endregion
Note: See TracChangeset
for help on using the changeset viewer.