public static void SetupCategories(GanttChart ganttChart) {
   ganttChart.AddCategory(TaskState.Offline.ToString(), Color.Gainsboro);
   ganttChart.AddCategory(TaskState.Waiting.ToString(), Color.NavajoWhite);
   ganttChart.AddCategory(TaskState.Paused.ToString(), Color.PaleVioletRed);
   ganttChart.AddCategory(TaskState.Transferring.ToString(), Color.CornflowerBlue);
   ganttChart.AddCategory(TaskState.Calculating.ToString(), Color.DarkGreen);
   ganttChart.AddCategory(TaskState.Finished.ToString(), Color.White);
   ganttChart.AddCategory(TaskState.Aborted.ToString(), Color.Orange);
   ganttChart.AddCategory(TaskState.Failed.ToString(), Color.Red);
 }
    public static void AddData(GanttChart ganttChart, string name, StateLog from, StateLog to, DateTime upperLimit) {
      DateTime until = to != null ? to.DateTime : upperLimit;
      TimeSpan duration = until - from.DateTime;
      string tooltip = string.Format("Task: {0} " + Environment.NewLine + "Task Id: {1}" + Environment.NewLine + "State: {2} " + Environment.NewLine + "Duration: {3} " + Environment.NewLine + "{4} - {5}" + Environment.NewLine, from.TaskName, from.TaskId, from.State, duration, from.DateTime, until);

      if (to != null && to.SlaveId != null)
        tooltip += "Slave: " + to.SlaveId;

      if (!string.IsNullOrEmpty(from.Exception))
        tooltip += Environment.NewLine + from.Exception;
      ganttChart.AddData(name, from.State.ToString(), from.DateTime, until, tooltip, false);
    }