ILOG Elixir provides you with two types of Flex-based Gantt Charts:
However ILOG Elixir does not provide you as-is with a 3rd type of Gantt Chart called the Reservation Chart. That chart gives you the ability to mix the task view (i.e. a single task per line) with the ability to display task per-resources as all tasks of a given resource are grouped on the display.
This view avoids the overstepping of tasks that often comes with the Resource Chart while still getting the resource information as a major part of the display. Finally it also brings the ability to display the constraints between tasks on a resource-based view.
Discussing with Emmanuel from our .NET/Silverlight visualization group last week, he explained me how they managed to implement the Reservation Chart based on a Task Chart. Following the discussion I decided to give it a try and see if ILOG Elixir users would be able to get at least a basic Reservation Chart from our Task Chart. Actually it was quite simple thanks to both ILOG Elixir
Let's imagine you have the following data:
[Bindable] public var rese
<ilog:ResourceChart width="100%" height="100%" task
You will get this result (note that constraints are not displayed in Resource Chart view).The first step in displaying these data in a Reservation Chart mode instead of Resource Chart is to switch the
<ilog:TaskChart width="100%" height="100%" cons
and you get this display.You now have a task per line, and constraints are displayed. However if you have the name of the resource listed on the left hand side in the data grid, you don't really have a resource view as all tasks from a given resource are not grouped. So the missing step to get the Reservation Chart is to do this grouping, for that you just switch the Flex
<ilog:TaskChart width="100%" height="100%" cons
Note that we have to explicitely call refresh() on the GroupingCollection after it is configured, otherwise it will appear empty. Here the call is performed in the initialize event of the data grid.
You can also see that I have redefined the default task renderer to make sure summary lines are not displayed. Indeed in Reservation Chart summaries usually don't get displayed. Of course if you want to, you can just use the default renderer and you will get summaries for each resource being displayed.
After these relatively simple steps, you finally get a simple Reservation Chart display.
Next step would be to bring Resource Chart-like interaction to the Reservation Chart (like re-assignment), not sure if that is easily feasible from the outside though. If you are interested in looking at this, you can download the Flex Builder project here. You will need ILOG Elixir 2.0 (public beta on our lab site) in order to compile and run the project.
Sometimes tasks are overlapping in your Gantt application and you would like users to be aware of the condition so they can react to it. This post is a continuation and rework of a previous post on the ILOG Elixir forum. I am developing the topic here because the answer on the forum was incomplete:
A look at the result:
To implement this I have created the following classes:
You can download the corresponding FlexBuilder project here.
Although extending the GanttSheet is not required to achieve the result, it has the advantage of encapsulating the handling of overlapping in a single place. It is very simple to use and reuse in your applications, as you can see:
<ilog:ResourceChart id="resourceChart" width="100%" height="100%" reso
The steps to get to there are:
Renderering overlapping tasks
We need a renderer that knows how to provide a visual clue on the overlapping condition of the task. For that purpose we create an
override protected function upda
The call to
Detecting overlap and refreshing the other tasks
I am not going to get into all the details of how things work, but I'll sketch the steps. Those interested can read the attached source of the CustomGanttSheet class which is documented.
To provide continuous update of the tasks below the task being edited, we need to:
We also need to provide a method hasO
Listening to task editing steps
The GanttSheet dispatches events for all steps during the editing of tasks:
The handlers are installed with a lower priority than the default handler to make sure they are executed after the default handlers. Doing so allows the adjustements to the values of start time and end time to occur in your own event handlers or in the default handlers. Thus the detection of overlapping is done using the actual values.
Invalidating tasks renderers
We have the triggers. Now we need to refresh some tasks.
How? We refresh the display for the tasks by calling
Which tasks to refresh? To simplify things we refresh all siblings of the edited task: the current siblings, but also the previous siblings in case of a reassignment of the task to a new resource:
private function hand
public function getT
We now have a custom GanttSheet that can can detect overlapping conditions on tasks, and that triggers refresh of overlapped tasks whenever a task is moved, resized or reassigned. This class can be seamlessly integrated into your application. It is also very easy to customize your task item renderer to render the overlapping condition.
I hope that in the process you learned something on the item editing events of the GanttSheet, on renderers and on refreshing them.