Replacement for TimeAllocation

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
wiesi
Posts: 27
Joined: Thu Aug 21, 2003 4:49 pm

Replacement for TimeAllocation

Post by wiesi » Tue Aug 26, 2003 9:27 am

Hi,

the class TimeAllocation is no longer included in the new version of JFreeChart (I am using 0.9.8 ), what is the replacement for it and how can I add multiple time-ranges to a "Task" (for Gantt-Chart)? I´d like to show a time-range on one task with breaks.

That´s my code so far:

TaskSeries t = new TaskSeries("brutto");
TaskSeries t2 = new TaskSeries("netto");

t.add(new Task("task1", new SimpleTimePeriod(new Date(100590207),new Date(200390107))));
t2.add(new Task("task1", new SimpleTimePeriod(new Date(1005902070),new Date(2003901070))));

TaskSeriesCollection mydataset = new TaskSeriesCollection();
mydataset.add(t);
mydataset.add(t2);


What do I need to do? Adding

t.add(new Task("task1", new SimpleTimePeriod(new Date(300390107),new Date(400390107))));

is not working ?


Maybe someone´s able to help me?


Regards,
Wiesi

wiesi
Posts: 27
Joined: Thu Aug 21, 2003 4:49 pm

Post by wiesi » Tue Aug 26, 2003 2:35 pm

I think I can do it with the function Task.addSubtask, like:

TaskSeries t = new TaskSeries("Brutto");

Task task1 = new Task ("task1", new SimpleTimePeriod(new Date(100590207),new Date(200390107)));
Task tasksub1 = new Task(null, new SimpleTimePeriod(new Date(300390107),new Date(400390107)));
task1.addSubtask(tasksub1);

t.add (task1);


but the Subtask is not shown. Any help?


Regards,
Wiesi

Locked