Skip to content
This repository has been archived by the owner. It is now read-only.
A simple PHP Gantt Class
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Show today marker even after last task Aug 17, 2012
styles Merge branch 'master' of Oct 4, 2012
.gitignore Ignore .DS_Store Aug 17, 2012
data.php first version Jul 24, 2012
index.php A few fixes Oct 4, 2012
readme.mdown added a readme and fixed the fucked up gitignore Jul 24, 2012



A simple PHP Gantt Class


  • Generates valid HTML5
  • Very easy to customize with SASS stylesheet
  • Works in all major browsers including IE7, IE8 and IE9
  • No javascript required





setlocale(LC_ALL, 'en_US');

$data = array();

$data[] = array(
  'label' => 'Project 1',
  'start' => '2012-04-20', 
  'end'   => '2012-05-12'

$data[] = array(
  'label' => 'Project 2',
  'start' => '2012-04-22', 
  'end'   => '2012-05-22', 
  'class' => 'important',

$data[] = array(
  'label' => 'Project 3',
  'start' => '2012-05-25', 
  'end'   => '2012-06-20'
  'class' => 'urgent',

$gantti = new Gantti($data, array(
  'title'      => 'Demo',
  'cellwidth'  => 25,
  'cellheight' => 35

echo $gantti;



Data is defined as an associative array (see the example above).

For each project you get the following options:

  • label: The label will be displayed in the sidebar
  • start: The start date. Must be in the following format: YYYY-MM-DD
  • end: The end date. Must be in the following format: YYYY-MM-DD
  • class: An optional class name. (available by default: important, urgent)


title (optional, default: false)

Set an optional title for your gantt diagram here. It will be displayed in the upper left corner.

cellwidth (optional, default: 40)

Set the width of all cells.

cellheight (optional, default: 40)

Set the height of all cells.

today (optional, default: true)

Show or hide the today marker. It will be displayed by default.


The default stylesheet is available as .scss (SASS) It includes a set of predefined variables, which you can use to adjust the styles very easily.


The default color theme is an adaption of the wonderful Solarized color theme by Ethan Schoonover


Bastian Allgeier


MIT License -

You can’t perform that action at this time.