注册 登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

天边云E家 shaoruisky

IT博文共享,知识的海洋

 
 
 

日志

 
 

php 甘特图类  

2013-11-19 17:36:34|  分类: php |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

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

<?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.

You can check out the full SASS file over here: https://github.com/bastianallgeier/gantti/blob/master/styles/scss/gantti.scss

Colors

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

  评论这张
 
阅读(225)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018