Giter Site home page Giter Site logo

gantti's Introduction

Gantti

A simple PHP Gantt Class

Features

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

Demo

http://bastianallgeier.com/gantti

Usage

<?php

require('lib/gantti.php'); 

date_default_timezone_set('UTC');
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

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)

Options

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.

Styles

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.

Colors

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

Author

Bastian Allgeier
http://bastianallgeier.com
http://twitter.com/bastianallgeier

License:

MIT License - http://www.opensource.org/licenses/mit-license.php

gantti's People

Contributors

bastianallgeier avatar cycloon avatar

Watchers

James Cloos avatar Xander avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.