I need to visualize overlapping of subtasks. In my case, a task is one person1, and subtasks of each task have descriptions "SignIn", "SignOut", "Click" (short-duration tasks), "Call" (long-duration task). What I want is to be able to: 1. See the overlap of 2 calls and see overlap of shortTasks and longTasks.
Something similar to this
My thoughts:
- Lower the transparency of subtasks, then the overlapping areas will be rendered as darker. (In real life, if there is a green object with
alpha 20
overlap or laying on top of a red object withalpha 100
, we should see a render of green + red in the overlapped area?) - Render the shortTasks on a overlay above longTasks, so that the short tasks will displayed above the long task. <-- Still haven't figured out how to do this in code
I've followed this Changing saturation of subtasks, changing transparency in getItemPaint
Color rbg = clut.get(clutIndex);
return new Color(rbg.getRed(), rbg.getGreen(), rbg.getBlue(), 150);
but it's not exactly what I'm looking for, since the overlapped areas are not demonstrated.
private @NotNull IntervalCategoryDataset createDataset() {
final TaskSeries s1 = new TaskSeries("Scheduled");
Task person1 = new Task("Person1",
new SimpleTimePeriod(date(1, Calendar.APRIL, 2001),
date(30, Calendar.APRIL, 2001)));
// Subtasks
Task subTask1 = new Task("SignIn",
new SimpleTimePeriod(date(1, Calendar.APRIL, 2001),
date(2, Calendar.APRIL, 2001))); // no overlap
Task subTask2 = new Task("Call1",
new SimpleTimePeriod(date(5, Calendar.APRIL, 2001),
date(20, Calendar.APRIL, 2001))); // day 5 - 20
Task subTask3 = new Task("Click",
new SimpleTimePeriod(date(16, Calendar.APRIL, 2001),
date(17, Calendar.APRIL, 2001))); // overlap with call1 and call2
Task subTask4 = new Task("Call2",
new SimpleTimePeriod(date(15, Calendar.APRIL, 2001),
date(30, Calendar.APRIL, 2001))); // day 15 - 30
person1.addSubtask(subTask1);
person1.addSubtask(subTask2);
person1.addSubtask(subTask3);
person1.addSubtask(subTask4);
s1.add(person1);
final TaskSeriesCollection collection = new TaskSeriesCollection();
collection.add(s1);
return collection;
}
How to code using my approach or is there any better approaches to achieve this? Thank you!