php 打印甘特图代码,php 甘特图类

Download

You can download the source for Gantti form Github:

https://github.com/bastianallgeier/gantti

Features

Generates valid HTML5

Very easy to customize with SASS stylesheet

Works in all major browsers including IE7, IE8 and IE9

No javascript required

Usage

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

cce544e7261bf3a4535656c82b969b03.png

转发至微博

cce544e7261bf3a4535656c82b969b03.png

转发至微博

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值