Changeset 15264 for trunk/sources
- Timestamp:
- 07/17/17 14:58:30 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs
r15122 r15264 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 int columnIndex = Matrix.ColumnNames.ToList().IndexOf(columnName); 639 640 //handle non-numeric values correctly 641 if (categoricalMapping.ContainsKey(columnIndex)) { 642 return Content.GetValue(run, columnName).ToString(); 643 } 644 645 double? value = GetValue(run, columnName); 646 if (!value.HasValue) return string.Empty; 647 648 string valueString = value.Value.ToString(); 649 650 //code to handle TimeSpanValues correctly 651 if (columnIndex > 0 && Content.GetValue(0, columnIndex) is TimeSpanValue) { 652 TimeSpan time = TimeSpan.FromSeconds(value.Value); 653 valueString = string.Format("{0:00}:{1:00}:{2:00.00}", (int)time.TotalHours, time.Minutes, time.Seconds); 654 } 655 656 return valueString; 650 657 } 651 658 #endregion
Note: See TracChangeset
for help on using the changeset viewer.