Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
178 lines (121 sloc) 4.049 kb
setlocale(LC_ALL, 'en_US');
$gantti = new Gantti($data, array(
'title' => 'Demo',
'cellwidth' => 25,
'cellheight' => 35,
'today' => true
<!DOCTYPE html>
<html lang="en">
<title>Mahatma Gantti – A simple PHP Gantt Class</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="styles/css/screen.css" />
<link rel="stylesheet" href="styles/css/gantti.css" />
<!--[if lt IE 9]>
<script src="//"></script>
<h1>Mahatma Gantti</h1>
<h2>A simple PHP Gantt Class</h2>
<?php echo $gantti ?>
You can download the source for Gantti form Github:<br />
<a href=""><strong></strong></a>
<li>Generates valid HTML5</li>
<li>Very easy to customize with SASS stylesheet</li>
<li>Works in all major browsers including IE7, IE8 and IE9</li>
<li>No javascript required</li>
<p><pre><code><?php $code = "
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;
echo htmlentities(trim($code)); ?>
<p>Data is defined as an associative array (see the example above).</p>
For each project you get the following options:
<li>label: The label will be displayed in the sidebar</li>
<li>start: The start date. Must be in the following format: YYYY-MM-DD</li>
<li>end: The end date. Must be in the following format: YYYY-MM-DD</li>
<li>class: An optional class name. (available by default: important, urgent)</li>
<h3>title (optional, default: false)</h3>
<p>Set an optional title for your gantt diagram here. <br />It will be displayed in the upper left corner. </p>
<h3>cellwidth (optional, default: 40)</h3>
<p>Set the width of all cells. </p>
<h3>cellheight (optional, default: 40)</h3>
<p>Set the height of all cells. </p>
<h3>today (optional, default: true)</h3>
<p>Show or hide the today marker. It will be displayed by default.</p>
The default stylesheet is available as .scss (<a href="">SASS</a>)
It includes a set of predefined variables, which you can use to adjust the styles very easily.
You can check out the full SASS file over here:
<a href=""></a>
<p>The default color theme is an adaption of the wonderful <br /><a href="">Solarized color theme by Ethan Schoonover</a></p>
Bastian Allgeier<br />
<a href=""></a><br />
<a href="">Follow me on Twitter</a>
MIT License – <a href=""></a>
<a href=""><img style="position: absolute; top: 0; right: 0; border: 0;" src="" alt="Fork me on GitHub"></a>
Jump to Line
Something went wrong with that request. Please try again.