Gantt chart requirement in Jfreechart 1.0.13

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
nsurendiran
Posts: 17
Joined: Mon Oct 26, 2009 12:07 pm
antibot: No, of course not.

Gantt chart requirement in Jfreechart 1.0.13

Post by nsurendiran » Tue Nov 03, 2009 9:13 am

Hi All,

I am displaying a gantt to show the resource utilization. In which I may have to show "more than one Gantt" for a resource.
For eg:

Parking stand as my domain Axis and Time (00:00 to 23:59) is my range Axis.

for a parking stand and occupancy time I am showing in Gantt

so it might have the values like I illustrated below.
Parking Stand 101 -> 04:00 - 06:30
Parking Stand 101 -> 08:00 - 13:30
Parking Stand 102 -> 04:00 - 23:30
Parking Stand 103 -> 03:00 - 03:30
Parking Stand 103 -> 07:00 - 08:30
This is for any given date.
So if I add the task only the last added is shown in the chart but not all.
What Should I do for this?

I have seen similar requirement has been asked in this forum but no correct solution is suggested here.

Any hope this time?

Thanks
Suren

nsurendiran
Posts: 17
Joined: Mon Oct 26, 2009 12:07 pm
antibot: No, of course not.

Re: Gantt chart requirement in Jfreechart 1.0.13

Post by nsurendiran » Tue Nov 03, 2009 10:35 am

Hi,

I found the below code is working for me. Ofcourse I found it in this same forum after some intensive search.

Code: Select all

final Task t1 = new Task("01",new SimpleTimePeriod(time("00","00"),	time("23","59")));
        
        final Task t2 = new Task("011", new SimpleTimePeriod(time("03","30"),time("09","00")));
        
        final Task t3 = new Task("012", new SimpleTimePeriod(time("13","30"),time("21","00")));
        
        t1.addSubtask(t2);
        t1.addSubtask(t3);
       
       s1.add(t1);
Now I got two Gantts in the same row. My next aim would be displaying Labels to each Gantts. previously I was getting Label , but when I added these subtasks I am not getting Labels at all for this row.

Any hint on this, again I am digging this forum by searching the previous posts!!

Locked