Alberto Pereto
Gantt.jpg (26047 bytes)

How to Reuse the Plandora Gantt Chart in my Project

The most important goal of an open source project is share with the technical public around the world, source-codes, frameworks or ideas. The Plandora tool was planned and designed to be used partially or fully. One of those "fragments" is the Gantt chart.

Until Plandora version 1.12.0, the Gantt chart was available in an applet format. It was build to be recycled in whatever web project (not necessarily a Java project) because all the data loaded by the chart, uses the <PARAM> tag of HTML standard (see the box bellow).

Into the <APPLET> tag, the attributes "code" and "archive" will contain the name of the "Gantt.jar" library.

Gantt Applet

See bellow the list of mandatory fields and all the features included into the Plandora Gantt Chart.

  • TIMEUNIT: It is the number (in miliseconds) of the smaller time unit of the Gantt chart. The PLANdora uses "60000" (1 minute).
  • SLOTSIZE: It is the number of "TimeUnits" for a Gantt slot. A slot represents the smaller part of a Job in Gantt. In PLAndora this field contain the value "1440" because for task planning purposes a slot represents 1 day (=1440 minutes).
  • PARENTSLOTSIZE: Is the of SlotSize but used to make groups of slots. Notice that the time line of Gantt Chart contain two layers. PLANdora uses "10080" for this fields because it groups the slots by week (SLOTSIZE * 7 = 10080).
  • EDITABLE: If "TRUE", allow the manipulation of Gantt by the user, otherwise, freeze the chart, and allow only the visualization.
  • HZOOM: It is the initial value (in pixels) for the horizontal zoom.
  • VZOOM: It is the initial value (in pixels) for the vertical zoom.
  • ROWHEIGHT: It is the height (in pixels) of a row of chart.
  • SLOTWIDTH: It is the width (in pixels) of a job slot of chart.
  • INITIALDATE: It is the date of the first slot (the earliest slot of chart). The format of date will depends the locale configured in "LANGUAGE" and "COUNTRY" fields. For example: for "pt-BR" locale, the date format used should be "DD/MM/YYYY".
  • SLOTS: The total number of slots of chart.
  • LANGUAGE: The language used for i18N purposes. It should contain a standard value (two charactes in lower case). For example: pt=Portuguese, en=English, es=Espanish.
  • COUNTRY: The country used for i18N purposes. It should contain a standard value (two characted in upper case). For example: BR=Brazil, US=USA, FR=France

There are 4 blocks of data structure used into chart.

  1. The Resource List (to populate the left list of chart);

  2. The Layer List (to separate each resource in layers);

  3. The Job List (to create the Jobs though each resource);

  4. The Alloc Unit List (to set the specific data for each slot or a group of slots of jobs).

  5. RESNUM: Total number of resources. Each "RES_" parameter bellow should be unique and should contain the same number of elements specificied by RESNUM.

  6. RES_?: Each element is a data structure divided by a separator (pipe) that contains: unique ID|a name of resource|a description of resource|the id of parent resource|number of layer.
  7. LAYERNUM: Total number of layers.
  8. LAYER_?: Each element is a data structure divided by pipe that contains: unique ID|position of layer on GUI|Name of Layer|Description of Layer|color (RGB format)|capacity (in minutes).
  9. JOBNUM: Total number os Jobs.
  10. JOB_?: Each element is a data structure divided by pipe that contains: unique ID|resource ID|Job ID|Description of Job|layer ID|mark type (0-none; 1-Dash Block; 2-Cross; 3-Dash).
  11. AUNITNUM: Total number os alloc units.
  12. AUNIT_?: Each element is a data structure divided by pipe that contains: job id|resource id|value of slot (to be used for any purposes)|initial slot|final slot|mark type (not implemented yet)
  1. For empty fields in RES_?, LAYER_?, JOB_?, etc, use a space between the two pipes. Otherwise, the parser fail.

  2. Click here to download the example bellow.

    <APPLET code="com.pandora.gui.gantt.Gantt.class" archive="gantt.jar" width="960" height="580">

    <param name="TIMEUNIT" value="60000" />
    <param name="SLOTSIZE" value="1440" />
    <param name="PARENTSLOTSIZE" value="10080" />

    <param name="NWMARKCOLOR" value="EFEFEF" />
    <param name="EDITABLE" value="TRUE" />

    <param name="HZOOM" value="10" />
    <param name="VZOOM" value="10" />

    <param name="ROWHEIGHT" value="18" />
    <param name="SLOTWIDTH" value="15" />

    <param name="INITIALDATE" value="27/07/05" />
    <param name="SLOTS" value="130" />
    <param name="LANGUAGE" value="pt" />
    <param name="COUNTRY" value="BR" />

    <param name="RESNUM" value="6" />
    <param name="RES_1" value="res1|Get the requirements|Get the requirements| |1" />
    <param name="RES_2" value="res2|Implementation|Implementation| |1" />
    <param name="RES_3" value="res3|Write the Unit Test|Write the Unit Test|res2|1" />
    <param name="RES_4" value="res4|Do the Implementation|Do the Implementation|res2|1" />
    <param name="RES_5" value="res5|Integrate the new Feature|Integrate the new Feature| |1" />
    <param name="RES_6" value="res6|Run the System test|Run the System test| |1" />

    <param name="LAYERNUM" value="2">
    <param name="LAYER_1" value="lay1|1|Clarice|Clarice Lispector|FFC7FF|480" />
    <param name="LAYER_2" value="lay2|2|Franz|Franz Kafka|9090CC|480" />

    <param name="JOBNUM" value="5">
    <param name="JOB_1" value="job1|res1|Job 1|Description of Job|lay1|0" />
    <param name="JOB_2" value="job2|res3|Job 1|Description of Job|lay2|0" />
    <param name="JOB_3" value="job3|res4|Job 1|Description of Job|lay2|0" />
    <param name="JOB_4" value="job4|res5|Job 1|Description of Job|lay2|0" />
    <param name="JOB_5" value="job5|res6|Job 1|Description of Job|lay1|0" />

    <param name="AUNITNUM" value="5">
    <param name="AUNIT_1" value="job1|res1|8|2|3|0" />
    <param name="AUNIT_2" value="job2|res3|8|4|6|0" />
    <param name="AUNIT_3" value="job3|res4|8|9|13|0" />
    <param name="AUNIT_4" value="job4|res5|8|16|20|0" />
    <param name="AUNIT_5" value="job5|res6|8|23|25|0" />

    <param name="BUTTONNUM" value="2">
    <param name="BUTTON_1" value="Zoom In|ZOOM_IN_BUTTON|target|TRUE|zoom-in.gif" />
    <param name="BUTTON_2" value="Zoom Out|ZOOM_OUT_BUTTON|target|trUe|zoom-out.gif" />

    <param name="MENUNUM" value="2">
    <param name="MENU_1" value="RESOURCE_AREA|Up Position|UP_RES_TARGET|" />
    <param name="MENU_2" value="RESOURCE_AREA|Down Position|DOWN_RES_TARGET|" />


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks