Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
171 lines (116 sloc) 3.48 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</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.
<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>