Jquery 甘特圖 外掛程式 jQuery.Gantt

來源:互聯網
上載者:User

http://taitems.github.io/jQuery.Gantt/


參數 預設值 類型 說明
source null Array, String (url) 資料來源:json數組或者返回json的url地址
itemsPerPage 7 Number 每頁顯示項目數
months ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] Array 月份對應的顯示字元
dow ["S", "M", "T", "W", "T", "F", "S"] Array 周日到周一的顯示字元
navigate "buttons" String ("buttons","scroll") 導航類型:按鈕和捲軸
scale "days" String 顯示單元
maxScale "months" String 視圖縮放最大單元
minScale "hours" String 視圖縮放最小單元
waitText "Please Wait..." String 載入時的提示文字
onItemClick: function (data) { return; }   點擊時執行的操作,參數是被點擊項目相關聯的資料對象
onAddClick function (dt, rowId) { return; }   在空白欄框子點擊時執行的函數
第一個參數是點擊點對應時間的毫秒數,第二個參數對象的id
onRender function () { return; }   甘特圖渲染完畢後執行的操作
useCookie false   聲明是是否使用cookie記錄圖表的狀態(縮放單元、捲軸位置)
需要使用jquery.cookie.js才能使用該選項
scrollToToday true Boolean 是否滾動到當天
Source Configuration 資料來源配置格式
source: [{name: "標題",desc: "描述.",values: [ ... ]}]
參數 預設值 類型 說明
name null String 甘特圖左側顯示的每行所對應的標題——體文字部分
desc null String 左側說明的描述部分
values null Array 甘特圖單元所對應的時間段等資訊,在右側的儲存格顯示
Value Configuration 資料來源的json數值對
values: [{to: "/Date(1328832000000)/",from: "/Date(1333411200000)/",desc: "滑鼠移至上方時的標題文字",label: "甘特圖項目標題",customClass: "ganttRed",dataObj: foo.bar[i]}]
參數 類型 說明
to String (Date) 結束時間(毫秒數,php返回時可以在時間戳記後添加3個0)
from String (Date) 開始時間
desc String 滑鼠移至上方到項目上個的提示文字Text that appears on hover, I think?
label String 甘特圖項目的標題文字
customClass String 添加到甘特圖項目的自訂類,可以用來標記甘特圖項目的顏色
dataObj All 點擊時應用到甘特圖項目的data對象


$(function() {"use strict";$(".gantt").gantt({source: [{name: "Sprint 0",desc: "Analysis",values: [{from: "/Date(1320192000000)/",to: "/Date(1322401600000)/",label: "Requirement Gathering",customClass: "ganttRed"}]},{name: " ",desc: "Scoping",values: [{from: "/Date(1322611200000)/",to: "/Date(1323302400000)/",label: "Scoping",customClass: "ganttRed"}]},{name: "Sprint 1",desc: "Development",values: [{from: "/Date(1323802400000)/",to: "/Date(1325685200000)/",label: "Development",customClass: "ganttGreen"}]},{name: " ",desc: "Showcasing",values: [{from: "/Date(1325685200000)/",to: "/Date(1325695200000)/",label: "Showcasing",customClass: "ganttBlue"}]},{name: "Sprint 2",desc: "Development",values: [{from: "/Date(1326785200000)/",to: "/Date(1325785200000)/",label: "Development",customClass: "ganttGreen"}]},{name: " ",desc: "Showcasing",values: [{from: "/Date(1328785200000)/",to: "/Date(1328905200000)/",label: "Showcasing",customClass: "ganttBlue"}]},{name: "Release Stage",desc: "Training",values: [{from: "/Date(1330011200000)/",to: "/Date(1336611200000)/",label: "Training",customClass: "ganttOrange"}]},{name: " ",desc: "Deployment",values: [{from: "/Date(1336611200000)/",to: "/Date(1338711200000)/",label: "Deployment",customClass: "ganttOrange"}]},{name: " ",desc: "Warranty Period",values: [{from: "/Date(1336611200000)/",to: "/Date(1349711200000)/",label: "Warranty Period",customClass: "ganttOrange"}]}],navigate: "scroll",maxScale: "hours",itemsPerPage: 10,onItemClick: function(data) {alert("Item clicked - show some details");},onAddClick: function(dt, rowId) {alert("Empty space clicked - add an item!");},onRender: function() {if (window.console && typeof console.log === "function") {console.log("chart rendered");}}});$(".gantt").popover({selector: ".bar",title: "I'm a popover",content: "And I'm the content of said popover.",trigger: "hover"});prettyPrint();});

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.