Changeset 7213 for branches/HeuristicLab.TimeSeries/HeuristicLab.Clients.Hive.Views/3.3/StateLog/StateLogGanttChartListView.cs
- Timestamp:
- 12/20/11 11:45:18 (12 years ago)
- Location:
- branches/HeuristicLab.TimeSeries
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.TimeSeries
-
branches/HeuristicLab.TimeSeries/HeuristicLab.Clients.Hive.Views/3.3/StateLog/StateLogGanttChartListView.cs
r6976 r7213 56 56 base.OnContentChanged(); 57 57 if (Content == null) { 58 // Add code when content has been changed and is null59 58 ganttChart.Reset(); 60 59 } else { 61 // Add code when content has been changed and is not null62 60 ganttChart.Reset(); 63 61 SetupCategories(ganttChart); 64 62 if (Content.Count > 0) { 65 63 DateTime maxValue = Content.Max(x => x.Count > 0 ? x.Max(y => y.DateTime) : DateTime.MinValue); 64 DateTime minValue = Content.Min(x => x.Count > 0 ? x.Min(y => y.DateTime) : DateTime.MinValue); 66 65 DateTime upperLimit; 67 66 if (Content.All(x => x.Count > 0 ? (x.Last().State == TaskState.Finished || x.Last().State == TaskState.Failed || x.Last().State == TaskState.Aborted) : true)) { … … 69 68 } else { 70 69 upperLimit = DateTime.Now; 70 } 71 72 if ((upperLimit - minValue) > TimeSpan.FromDays(1)) { 73 this.ganttChart.chart.Series[0].YValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Date; 74 } else { 75 this.ganttChart.chart.Series[0].YValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Time; 71 76 } 72 77 … … 98 103 DateTime until = to != null ? to.DateTime : upperLimit; 99 104 TimeSpan duration = until - from.DateTime; 100 string tooltip = string.Format(" State: {0} " + Environment.NewLine + " Duration: {1} " + Environment.NewLine + " {2} - {3}", from.State, duration, from.DateTime, until);105 string tooltip = string.Format("Task: {0} " + Environment.NewLine + "Task Id: {1}" + Environment.NewLine + "State: {2} " + Environment.NewLine + "Duration: {3} " + Environment.NewLine + "{4} - {5}", from.TaskName, from.TaskId, from.State, duration, from.DateTime, until); 101 106 if (!string.IsNullOrEmpty(from.Exception)) 102 107 tooltip += Environment.NewLine + from.Exception;
Note: See TracChangeset
for help on using the changeset viewer.