1

I have a .csv file containing TaskId and TaskStartTimerValue. I want to make a Gantt Graph displaying TaskId on the x axis and TaskStartTimervalue at the y axis. I am using a demo from this link this link at sanjaal.com.

The demo uses a SimpleTimePeriod method to get the timing range. Is there any other method available that I can use to pass my timer values?

chuff
  • 5,846
  • 1
  • 21
  • 26
user1871762
  • 359
  • 1
  • 2
  • 10

1 Answers1

1

As an alternative to TimePeriod, you can use the Task constructor that accepts two Date instances:

public Task(java.lang.String description,
    java.util.Date start,
    java.util.Date end)

Use an instance of Calendar to create your dates. In this example, there are two main tasks:

Task t1 = new Task("Design", date(1, MAY), date(31, MAY));
Task t2 = new Task("Proposal", date(1, JUNE), date(31, JUNE));

This simple auxiliary method, analogous to the example's makeDate(), generates dates for a fixed year:

private static Date date(final int day, final int month) {
    final Calendar calendar = Calendar.getInstance();
    calendar.set(2012, month, day);
    final Date result = calendar.getTime();
    return result;
}
Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • Thanks for help,Can you please suggest me how can I display our actual timer values. when I did it above way the timer values get converted to "Date"format,I do not want timer values in Date format. – user1871762 Feb 21 '13 at 03:28
  • You are welcome. Do you mean you want to change the format of the axis labels? – trashgod Feb 21 '13 at 03:34
  • yeah...I want whatever value I passed to Task, graph axis should display that actual value without converting it into "Date" format. – user1871762 Feb 21 '13 at 05:42
  • You can use `setDateFormatOverride()`, for [example](http://stackoverflow.com/a/2723103/230513). – trashgod Feb 21 '13 at 11:54