forked from Wavyzz/dolibarr
1168 lines
60 KiB
HTML
1168 lines
60 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en" class="no-js">
|
|
|
|
<!-- Head -->
|
|
<head>
|
|
<!-- Meta data -->
|
|
<meta charset="utf-8">
|
|
<title>jsGantt Improved</title>
|
|
<meta name="description" content="FREE javascript gantt - jsGantt Improved HTML, CSS and AJAX only">
|
|
<meta name="keywords" content="jsgantt-improved free javascript gantt-chart html css ajax">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
|
|
<!-- External resources -->
|
|
<!-- jQuery + Ajax [required by Bootstrap] -->
|
|
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
|
|
<!-- Required by smooth scrolling -->
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
|
|
<!-- Bootstrap v4.0.0 Alpha -->
|
|
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous" />
|
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
|
|
<!-- Font Awesome -->
|
|
<script src="https://use.fontawesome.com/78d1e57168.js"></script>
|
|
<!-- Google's Code Prettify -->
|
|
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?lang=css&skin=sunburst"></script>
|
|
<!-- Google Fonts -->
|
|
<link href="https://fonts.googleapis.com/css?family=Cookie|Satisfy|Kelly+Slab|Overlock" rel="stylesheet">
|
|
|
|
<!-- Internal resources -->
|
|
<!-- Webpage -->
|
|
<link href="main.css" rel="stylesheet" type="text/css" />
|
|
<script src="main.js" type="text/javascript"></script>
|
|
<!-- jsGanttImproved App -->
|
|
<link href="jsgantt.css" rel="stylesheet" type="text/css"/>
|
|
<script src="jsgantt.js" type="text/javascript"></script>
|
|
</head>
|
|
|
|
<!-- Content -->
|
|
<body data-spy="scroll" data-target="#my-navbar-nav">
|
|
<!-- Navigation bar -->
|
|
<nav class="navbar navbar-toggleable-md navbar-inverse bg-inverse fixed-top">
|
|
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#my-navbar-nav" aria-controls="my-navbar-nav" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<a class="navbar-brand product-name" id="my-nav-brand" href="#home">jsGanttImproved</a>
|
|
|
|
<div class="collapse navbar-collapse" id="my-navbar-nav">
|
|
<ul class="navbar-nav mr-auto" role="tablist">
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="#home">Home <span class="sr-only">(current)</span></a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="#demo">Demo</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="#features">Features</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="#usage">Usage</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="#credits">Credits</a>
|
|
</li>
|
|
</ul>
|
|
<form class="form-inline my-2 my-lg-0">
|
|
<a class="btn btn-outline-danger my-2 my-sm-0 mx-1" href="https://api.github.com/repos/jsGanttImproved/jsgantt-improved/zipball">Download</a>
|
|
<a class="btn btn-outline-primary my-2 my-sm-0 mx-1" href="https://github.com/jsGanttImproved/jsgantt-improved" target="_blank">View on GitHub</a>
|
|
</form>
|
|
</div>
|
|
</nav>
|
|
|
|
<!-- Content -->
|
|
<!-- Home -->
|
|
<div class="container-fluid" id="home">
|
|
<div class="row">
|
|
<div class="col-lg-6 text-center">
|
|
<h1 class="display-1 product-name" id="home-title">jsGanttImproved</h1>
|
|
<h2 class="display-2" id="home-subtitle">latest v1.7.5.4</h2>
|
|
<a class="btn btn-danger my-2 my-sm-0 mx-1" href="https://api.github.com/repos/jsGanttImproved/jsgantt-improved/zipball">Download</a>
|
|
<a class="btn btn-primary my-2 my-sm-0 mx-1" href="https://github.com/jsGanttImproved/jsgantt-improved" target="_blank">View on GitHub</a>
|
|
</div>
|
|
<div class="col-lg-6">
|
|
<div class="card text-center" id="slide-card">
|
|
<div class="card-block">
|
|
<span class="card-text slide">
|
|
<p><i class="fa fa-code slide-icon"></i></p>
|
|
<p>100% HTML + CSS + JavaScript Gantt Chart</p>
|
|
</span>
|
|
<span class="card-text slide">
|
|
<p><i class="fa fa-usd slide-icon"></i></p>
|
|
<p>Completely FREE</p>
|
|
</span>
|
|
<span class="card-text slide">
|
|
<p><i class="fa fa-github slide-icon"></i></p>
|
|
<p>Open source</p>
|
|
</span>
|
|
</div>
|
|
<div class="card-footer text-muted" id="slide-dots">
|
|
<span class="dot"></span>
|
|
<span class="dot"></span>
|
|
<span class="dot"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col text-center">
|
|
<a class="btn btn-outline-info" href="#demo" id="learn-more"><i class="fa fa-chevron-down"></i></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- Demo -->
|
|
<div class="container-fluid section" id="demo">
|
|
<h1>Demo</h1>
|
|
<div class="btn-group" data-toggle="buttons">
|
|
<label class="btn btn-primary btn-demo">
|
|
<input type="checkbox" autocomplete="off"><i class="fa fa-code"></i> Embedded Code
|
|
</label>
|
|
<label class="btn btn-primary btn-demo">
|
|
<input type="checkbox" autocomplete="off"><i class="fa fa-file-code-o"></i> External XML File
|
|
</label>
|
|
</div>
|
|
<div id="embedded-Gantt">
|
|
<script type="text/javascript">
|
|
var g = new JSGantt.GanttChart(document.getElementById('embedded-Gantt'), 'week');
|
|
if (g.getDivId() != null) {
|
|
g.setCaptionType('Complete'); // Set to Show Caption (None,Caption,Resource,Duration,Complete)
|
|
g.setQuarterColWidth(36);
|
|
g.setDateTaskDisplayFormat('day dd month yyyy'); // Shown in tool tip box
|
|
g.setDayMajorDateDisplayFormat('mon yyyy - Week ww') // Set format to display dates in the "Major" header of the "Day" view
|
|
g.setWeekMinorDateDisplayFormat('dd mon') // Set format to display dates in the "Minor" header of the "Week" view
|
|
g.setShowTaskInfoLink(1); // Show link in tool tip (0/1)
|
|
g.setShowEndWeekDate(0); // Show/Hide the date for the last day of the week in header for daily view (1/0)
|
|
g.setUseSingleCell(10000); // Set the threshold at which we will only use one cell per table row (0 disables). Helps with rendering performance for large charts.
|
|
g.setFormatArr('Day', 'Week', 'Month', 'Quarter'); // Even with setUseSingleCell using Hour format on such a large chart can cause issues in some browsers
|
|
// Parameters (pID, pName, pStart, pEnd, pStyle, pLink (unused) pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption, pNotes, pGantt)
|
|
g.AddTaskItem(new JSGantt.TaskItem(1, 'Define Chart API', '', '', 'ggroupblack', '', 0, 'Brian', 0, 1, 0, 1, '', '', 'Some Notes text', g ));
|
|
g.AddTaskItem(new JSGantt.TaskItem(11, 'Chart Object', '2017-02-20','2017-02-20', 'gmilestone', '', 1, 'Shlomy', 100, 0, 1, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(12, 'Task Objects', '', '', 'ggroupblack', '', 0, 'Shlomy', 40, 1, 1, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(121, 'Constructor Proc', '2017-02-21','2017-03-09', 'gtaskblue', '', 0, 'Brian T.', 60, 0, 12, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(122, 'Task Variables', '2017-03-06','2017-03-11', 'gtaskred', '', 0, 'Brian', 60, 0, 12, 1, 121, '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(123, 'Task by Minute/Hour', '2017-03-09','2017-03-14 12:00', 'gtaskyellow', '', 0, 'Ilan', 60, 0, 12, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(124, 'Task Functions', '2017-03-09','2017-03-29', 'gtaskred', '', 0, 'Anyone', 60, 0, 12, 1, '123SS', 'This is a caption', null, g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(2, 'Create HTML Shell', '2017-03-24','2017-03-24', 'gtaskyellow', '', 0, 'Brian', 20, 0, 0, 1, 122, '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(3, 'Code Javascript', '', '', 'ggroupblack', '', 0, 'Brian', 0, 1, 0, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(31, 'Define Variables', '2017-02-25','2017-03-17', 'gtaskpurple', '', 0, 'Brian', 30, 0, 3, 1, '', 'Caption 1','', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(32, 'Calculate Chart Size', '2017-03-15','2017-03-24', 'gtaskgreen', '', 0, 'Shlomy', 40, 0, 3, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(33, 'Draw Task Items', '', '', 'ggroupblack', '', 0, 'Someone', 40, 2, 3, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(332, 'Task Label Table', '2017-03-06','2017-03-09', 'gtaskblue', '', 0, 'Brian', 60, 0, 33, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(333, 'Task Scrolling Grid', '2017-03-11','2017-03-20', 'gtaskblue', '', 0, 'Brian', 0, 0, 33, 1, '332', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(34, 'Draw Task Bars', '', '', 'ggroupblack', '', 0, 'Anybody', 60, 1, 3, 0, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(341, 'Loop each Task', '2017-03-26','2017-04-11', 'gtaskred', '', 0, 'Brian', 60, 0, 34, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(342, 'Calculate Start/Stop', '2017-04-12','2017-05-18', 'gtaskpink', '', 0, 'Brian', 60, 0, 34, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(343, 'Draw Task Div', '2017-05-13','2017-05-17', 'gtaskred', '', 0, 'Brian', 60, 0, 34, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(344, 'Draw Completion Div', '2017-05-17','2017-06-04', 'gtaskred', '', 0, 'Brian', 60, 0, 34, 1, "342,343",'', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(35, 'Make Updates', '2017-07-17','2017-09-04', 'gtaskpurple', '', 0, 'Brian', 30, 0, 3, 1, '333', '', '', g));
|
|
|
|
g.Draw();
|
|
} else {
|
|
alert("Error, unable to create Gantt Chart");
|
|
}
|
|
</script>
|
|
</div>
|
|
<div id="external-Gantt">
|
|
<script type="text/javascript">
|
|
var g = new JSGantt.GanttChart(document.getElementById('external-Gantt'), 'day');
|
|
|
|
if (g.getDivId() != null) {
|
|
g.setCaptionType('Resource'); // Set to Show Caption (None,Caption,Resource,Duration,Complete)
|
|
g.setShowTaskInfoLink(1); // Show link in tool tip (0/1)
|
|
g.setDayMajorDateDisplayFormat('dd mon');
|
|
g.setDateTaskDisplayFormat('dd month yyyy HH:MI');
|
|
// Use the XML file parser
|
|
JSGantt.parseXML('project.xml', g)
|
|
|
|
g.Draw();
|
|
} else {
|
|
alert("Error, unable to create Gantt Chart");
|
|
}
|
|
</script>
|
|
</div>
|
|
</div>
|
|
<!-- Features -->
|
|
<div class="container-fluid section" id="features">
|
|
<h1>Features</h1>
|
|
<p>jsGanttImproved is a fully featured gantt chart component built entirely in Javascript, CSS and AJAX. It is lightweight and there is no need of external libraries or additional images.</p>
|
|
<div class="row">
|
|
<div class="col-lg">
|
|
<h2>Basic Features</h2>
|
|
<ul>
|
|
<li>Tasks & Collapsible Task Groups</li>
|
|
<li>Multiple Dependencies</li>
|
|
<li>Task Completion</li>
|
|
<li>Task Style</li>
|
|
<li>Milestones</li>
|
|
<li>Resources</li>
|
|
</ul>
|
|
</div>
|
|
<div class="col-lg">
|
|
<h2>Advanced Features</h3>
|
|
<ul>
|
|
<li>Dynamic Loading of Tasks</li>
|
|
<li>Dynamic change of format: Hour, Day, Week, Month, Quarter</li>
|
|
<li>
|
|
Load Gantt from:
|
|
<ul>
|
|
<li>External XML files (including experimental support for Microsoft Project XML files)</li>
|
|
<li>JavaScript strings</li>
|
|
</ul>
|
|
</li>
|
|
<li>Export Gantt as XML string</li>
|
|
<li>Support for internationalization</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<h2>Current Known Issues:</h3>
|
|
<ul>
|
|
<li>If the browser is viewing the page at anything other than 100% zoom then bars may not be sized or positioned correctly.</li>
|
|
</ul>
|
|
<h2>Changelog:</h3>
|
|
<p>Check the full list of changes on <a href="https://github.com/jsGanttImproved/jsgantt-improved/releases">GitHub releases page</a>.</p>
|
|
<h3>v1.7.5.4:</h3>
|
|
<ul>
|
|
<li>Left part of the chart is now created first on JavaScript and establishes the left floating reference</li>
|
|
<li>Minimum width updated to 632px so that the left part of the chart has a fixed width of 532px and the right part fills out the rest with a minimum of 100px</li>
|
|
</ul>
|
|
<h3>v1.7.5.3:</h3>
|
|
<ul>
|
|
<li>Fixed group completion percentage that now is a weighted average</li>
|
|
<li>Start and end dates specified on standard group tasks will now be respected if they fall outside of the calculated group date range</li>
|
|
<li>Fixed problem that would occur if Tool Tips were disabled</li>
|
|
<li>Moved example dates forward so the current date marker is visible</li>
|
|
</ul>
|
|
<h3>v1.7.5:</h3>
|
|
<ul>
|
|
<li>Project Migrated to GitHub</li>
|
|
<li>Instantiating a new JSGantt.TaskItem will now also accept Date objects for start and end dates</li>
|
|
<li>Fixed old Internet Explorer compatibilty broken by v1.7</li>
|
|
<li>Fixed bug in Iso week date format</li>
|
|
<li>Changed to solid arrows on dependency lines to be more printer friendly</li>
|
|
<li>Code refactoring and clean up</li>
|
|
</ul>
|
|
<h3>v1.7:</h3>
|
|
<ul>
|
|
<li>
|
|
Fixed nasty long-standing bug where the first Gantt chart created must be stored in a javascript variable named "g"
|
|
<ul>
|
|
<li>NOTE: This required a change in the method to instatiate a JSGantt.TaskItem object to pass the related chart.</li>
|
|
<li>A temporary fix is included that still assumes the use of "g" for the chart if the chart object is not passed, this will be removed in v1.8</li>
|
|
</ul>
|
|
</li>
|
|
<li>Altered XML export functionality so that dates are output in the specified input format for the chart</li>
|
|
<li>Added method to read XML directly from an input string</li>
|
|
<li>Prevented creation of a task with a duplicate "unique" ID</li>
|
|
<li>Fixed bug where attempting to remove the first task defined would prevent the chart from redrawing</li>
|
|
<li>Some general code clean up</li>
|
|
</ul>
|
|
</div>
|
|
<!-- Usage -->
|
|
<div class="container-fluid section" id="usage">
|
|
<h1>Usage</h1>
|
|
<p>Following the steps below you will be able to get create a basic Gantt Chart. If you notice any bugs, please post them to <a href="https://github.com/jsGanttImproved/jsgantt-improved/issues">GitHub issues</a>.</p>
|
|
<ol>
|
|
<li>
|
|
Include JSGantt CSS and Javascript
|
|
<pre class="prettyprint lang-html code-block"><code><link rel="stylesheet" type="text/css" href="jsgantt.css" />
|
|
<script language="javascript" src="jsgantt.js"></script></code></pre>
|
|
</li>
|
|
<li>
|
|
Create a div element to hold the gantt chart
|
|
<pre class="prettyprint lang-html"><code><div style="position:relative" class="gantt" id="GanttChartDIV"></div></code></pre>
|
|
</li>
|
|
<li>
|
|
Start a <script> block
|
|
<pre class="prettyprint lang-html"><code><script type="text/javascript"></code></pre>
|
|
</li>
|
|
<li>
|
|
Instantiate JSGantt using GanttChart()
|
|
<pre class="prettyprint lang-js"><code>var g = new JSGantt.GanttChart(document.getElementById('GanttChartDIV'), 'day');</code></pre>
|
|
<p>Method definition:
|
|
<strong>GanttChart(<em>pDiv, pFormat</em>)</strong>
|
|
</p>
|
|
<p><table>
|
|
<tr>
|
|
<th>pDiv:</th>
|
|
<td>(required) this is a DIV object created in HTML</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pFormat:</th>
|
|
<td>(required) - used to indicate whether chart should be drawn in "hour", "day", "week", "month", or "quarter" format</td>
|
|
</tr>
|
|
</table></p>
|
|
</li>
|
|
<li>
|
|
<p>Customize the look and feel using configuration methods (see <a href="#options">Configuration Options</a>)</p>
|
|
</li>
|
|
<li>
|
|
Add Tasks
|
|
<ul>
|
|
<li>
|
|
using AddTaskItem()
|
|
<pre class="prettyprint lang-js"><code>g.AddTaskItem(new JSGantt.TaskItem(1, 'Define Chart API','', '', 'ggroupblack','', 0, 'Brian', 0, 1,0,1,'','','Some Notes text',g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(11,'Chart Object', '2016-02-20','2016-02-20','gmilestone', '', 1, 'Shlomy',100,0,1,1,'','','',g));
|
|
</code></pre>
|
|
<p>Method definition:
|
|
<strong>TaskItem(<em>pID, pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption, pNotes, pGantt</em>)</strong>
|
|
</p>
|
|
<table>
|
|
<tr>
|
|
<th>pID:</th>
|
|
<td>(required) a unique numeric ID used to identify each row</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pName:</th>
|
|
<td>(required) the task Label</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pStart:</th>
|
|
<td>(required) the task start date, can enter empty date ('') for groups. You can also enter specific time (2016-02-20 12:00) for additional precision.</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pEnd:</th>
|
|
<td>(required) the task end date, can enter empty date ('') for groups</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pClass:</th>
|
|
<td>(required) the css class for this task</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pLink:</th>
|
|
<td>(optional) any http link to be displayed in tool tip as the "More information" link.</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pMile:</th>
|
|
<td>(optional) indicates whether this is a milestone task - Numeric; 1 = milestone, 0 = not milestone</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pRes:</th>
|
|
<td>(optional) resource name</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pComp:</th>
|
|
<td>(required) completion percent, numeric</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pGroup:</th>
|
|
<td>(optional) indicates whether this is a group task (parent) - Numeric; 0 = normal task, 1 = standard group task, 2 = combined group task<a href='#combinedtasks' class="footnote">*</a></td>
|
|
</tr>
|
|
<tr>
|
|
<th>pParent:</th>
|
|
<td>(required) identifies a parent pID, this causes this task to be a child of identified task. Numeric, top level tasks should have pParent set to 0</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pOpen:</th>
|
|
<td>(required) indicates whether a standard group task is open when chart is first drawn. Value must be set for all items but is only used by standard group tasks. Numeric, 1 = open, 0 = closed</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pDepend:</th>
|
|
<td>
|
|
(optional) comma separated list of id's this task is dependent on. A line will be drawn from each listed task to this item<br />Each id can optionally be followed by a dependency type suffix. Valid values are:
|
|
<blockquote>'FS' - Finish to Start (default if suffix is omitted)<br />'SF' - Start to Finish<br />'SS' - Start to Start<br />'FF' - Finish to Finish</blockquote>
|
|
If present the suffix must be added directly to the id e.g. '123SS'
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pCaption:</th>
|
|
<td>(optional) caption that will be added after task bar if CaptionType set to "Caption"</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pNotes:</th>
|
|
<td>(optional) Detailed task information that will be displayed in tool tip for this task</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pGantt:</th>
|
|
<td>(required) javascript JSGantt.GanttChart object from which to take settings. Defaults to "g" for backwards compatibility</td>
|
|
</tr>
|
|
</table>
|
|
<p id='combinedtasks'><span style="color: red;">*</span> Combined group tasks show all sub-tasks on one row. The information displayed in the task list and row caption are taken from the parent task. Tool tips are generated individually for each sub-task from its own information. Milestones are not valid as sub-tasks of a combined group task and will not be displayed. No bounds checking of start and end dates of sub-tasks is performed therefore it is possible for these task bars to overlap. Dependencies can be set to and from sub-tasks only.</p>
|
|
</li>
|
|
<li>
|
|
using parseXML() with an external XML file
|
|
<pre class="prettyprint lang-js"><code>JSGantt.parseXML("project.xml",g);</code></pre>
|
|
<p>Method definition:
|
|
<strong>JSGantt.parseXML(<em>pFile, pGanttObj</em>)</strong>
|
|
</p>
|
|
<table>
|
|
<tr>
|
|
<th>pFile:</th>
|
|
<td>(required) this is the filename of the XML</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pGanttObj:</th>
|
|
<td>(required) a GanttChart object returned by a call to JSGantt.GanttChart()</td>
|
|
</tr>
|
|
</table>
|
|
<p>The structure of the native XML file:</p>
|
|
<pre class="prettyprint lang-ml"><code><project>
|
|
<task>
|
|
<pID>25</pID>
|
|
<pName>WCF Changes</pName>
|
|
<pStart></pStart>
|
|
<pEnd></pEnd>
|
|
<pClass>gtaskred</pClass>
|
|
<pLink></pLink>
|
|
<pMile>0</pMile>
|
|
<pRes></pRes>
|
|
<pComp>0</pComp>
|
|
<pGroup>1</pGroup>
|
|
<pParent>2</pParent>
|
|
<pOpen>1</pOpen>
|
|
<pDepend>2,24</pDepend>
|
|
<pCaption>A caption</pCaption>
|
|
<pNotes>Text - can include limited HTML</pNotes>
|
|
</task>
|
|
</project></code></pre>
|
|
<p>Field definitions are as described for the parameters to TaskItem above. The pClass element is optional in XML files and will default to "ggroupblack" for group tasks, "gtaskblue" for normal tasks and "gmilestone" for milestones. The pGantt element is not required for XML import.</p>
|
|
<p>JSGannt Improved will also test the provided XML file to see if it appears to be in Microsoft Project XML format. If so an attempt will be made to load up the project. This feature is experimental, the import is best effort and not guaranteed. Once loaded the project as interpreted by JSGantt Improved can be extracted using the <a href="#xmlExport">XML Export methods</a> provided.</p>
|
|
</li>
|
|
<li>
|
|
using parseXMLString() with XML held in a javascript string object
|
|
<pre class="prettyprint lang-js"><code>JSGantt.parseXMLString("<project><task>...</task></project>",g);</code></pre>
|
|
<p>Method definition:
|
|
<strong>JSGantt.parseXMLString(<em>pStr, pGanttObj</em>)</strong>
|
|
</p>
|
|
<table>
|
|
<tr>
|
|
<th>pStr:</th>
|
|
<td>(required) this is a javascript String containing XML</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pGanttObj:</th>
|
|
<td>(required) a GanttChart object returned by a call to JSGantt.GanttChart()</td>
|
|
</tr>
|
|
</table>
|
|
<p>The XML provided will be parsed in exactly the same way as the contents of an external XML file and hence must match the format as described for JSGantt.parseXML() above</p>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<p>Call Draw()</p>
|
|
<pre class="prettyprint lang-js"><code>g.Draw();</code></pre>
|
|
</li>
|
|
<li>
|
|
<p>Close the <script> block</p>
|
|
<pre class="prettyprint lang-html"><code></script></code></pre>
|
|
</li>
|
|
</ol>
|
|
<p>It is possible to add items to the chart in realtime via javascript using either direct method calls or additional XML files.
|
|
It is also possible to delete tasks using RemoveTaskItem() method.
|
|
</p>
|
|
<pre class="prettyprint lang-js"><code>g.RemoveTaskItem(11);</code></pre>
|
|
<p>Method definition:
|
|
<strong>RemoveTaskItem(<em>pID</em>)</strong>
|
|
</p>
|
|
<table>
|
|
<tr>
|
|
<th>pID:</th>
|
|
<td>(required) the unique numeric ID of the item to be removed</td>
|
|
</tr>
|
|
</table>
|
|
<p>If the task removed is a group item, all child tasks will also be removed. </p>
|
|
<p>After adding or removing tasks a call to "g.Draw()" must be made to redraw the chart.</p>
|
|
<h2 id="options">Configuration Options</h2>
|
|
<h3>Switches</h3>
|
|
<p>Many of the features of jsGanttImproved can be customised through the use of setter methods available on the GanttChart object returned by a call to JSGantt.GanttChart()</p>
|
|
<p>The following options take a single numeric parameter; a value of 1 will enable the describe functionality, 0 will disable it</p>
|
|
<table class="configlist">
|
|
<tr>
|
|
<th id="setUseToolTip">setUseToolTip():</th>
|
|
<td>Controls the display of tool tip boxes, defaults to 1 (enabled)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setUseFade">setUseFade():</th>
|
|
<td>Controls use of the fade effect when showing/hiding tool tips, defaults to 1 (enabled)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setUseMove">setUseMove():</th>
|
|
<td>Controls use of the sliding effect when changing between different task tool tips, defaults to 1 (enabled)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setUseRowHlt">setUseRowHlt():</th>
|
|
<td>Controls the use of row mouseover highlighting, defaults to 1 (enabled)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setUseSort">setUseSort():</th>
|
|
<td>Controls whether the task list is sorted into parent task / start time order or is simply displayed in the order created, defaults to 1 (sort enabled)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setShowRes">setShowRes():</th>
|
|
<td>Controls whether the Resource column is displayed in the task list, defaults to 1 (show column)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setShowDur">setShowDur():</th>
|
|
<td>Controls whether the Task Duration column is displayed in the task list, defaults to 1 (show column)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setShowComp">setShowComp():</th>
|
|
<td>Controls whether the Percentage Complete column is displayed in the task list, defaults to 1 (show column)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setShowStartDate">setShowStartDate():</th>
|
|
<td>Controls whether the Task Start Date column is displayed in the task list, defaults to 1 (show column)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setShowEndDate">setShowEndDate():</th>
|
|
<td>Controls whether the Task End Date column is displayed in the task list, defaults to 1 (show column)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setShowTaskInfoRes">setShowTaskInfoRes():</th>
|
|
<td>Controls whether the Resource information is displayed in the task tool tip, defaults to 1 (show information)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setShowTaskInfoDur">setShowTaskInfoDur():</th>
|
|
<td>Controls whether the Task Duration information is displayed in the task tool tip, defaults to 1 (show information)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setShowTaskInfoComp">setShowTaskInfoComp():</th>
|
|
<td>Controls whether the Percentage Complete information is displayed in the task tool tip, defaults to 1 (show information)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setShowTaskInfoStartDate">setShowTaskInfoStartDate():</th>
|
|
<td>Controls whether the Task Start Date information is displayed in the task tool tip, defaults to 1 (show information)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setShowTaskInfoEndDate">setShowTaskInfoEndDate():</th>
|
|
<td>Controls whether the Task End Date information is displayed in the task tool tip, defaults to 1 (show information)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setShowTaskInfoLink">setShowTaskInfoLink():</th>
|
|
<td>Controls whether the More Information link is displayed in the task tool tip, defaults to 0 (do NOT show link)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setShowTaskInfoNotes">setShowTaskInfoNotes():</th>
|
|
<td>Controls whether the Additional Notes data is displayed in the task tool tip, defaults to 1 (show notes)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setShowEndWeekDate">setShowEndWeekDate():</th>
|
|
<td>Controls whether the major heading in "Day" view displays the week end-date in the appropriate format (see <a href="#setDayMajorDateDisplayFormat">below</a>), defaults to 1 (show date)</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setShowDeps">setShowDeps():</th>
|
|
<td>Controls display of dependancy lines, defaults to 1 (show dependencies)</td>
|
|
</tr>
|
|
</table>
|
|
<h3>Key Values</h3>
|
|
<p>The following options enable functionality using a set of specific key values</p>
|
|
<table class="configlist">
|
|
<tr>
|
|
<th id="setShowSelector">setShowSelector():</th>
|
|
<td>Controls where the format selector is displayed, accepts multiple parameters.<br/>Valid parameter values are "Top", "Bottom".<br/>Defaults to "Top".</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setFormatArr">setFormatArr():</th>
|
|
<td>Controls which format options are shown in the format selector, accepts multiple parameters.<br/>Valid parameter values are "Hour", "Day", "Week", "Month", "Quarter".<br/>Defaults to all valid values.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setCaptionType">setCaptionType():</th>
|
|
<td>Controls which task field to use as a caption on the Gantt Chart task bar, accepts a single parameter.<br/>Valid parameter values are "None", "Caption", "Resource", "Duration", "Complete".<br/>Defaults to "None"</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setDateInputFormat">setDateInputFormat():</th>
|
|
<td>Defines the input format used for dates in task creation, accepts a single parameter.<br/>Valid parameter values are "yyyy-mm-dd", "dd/mm/yyyy", "mm/dd/yyyy".<br/>Defaults to "yyyy-mm-dd"</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setScrollTo">setScrollTo():</th>
|
|
<td>Sets the date the Gantt Chart will be scrolled to, specified in the date input format set by setDateInputFormat() above. Also accepts the special value "today"<br/>Defaults to minimum display date</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setUseSingleCell">setUseSingleCell():</th>
|
|
<td>Sets the threshold total number of cells at which the task list will use a single table cell for each row rather than one cell per period. Useful to improve performance on large charts. A value of 0 disables this functionality (always use multiple cells), defaults to 25000</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setLang">setLang():</th>
|
|
<td>Sets translation to use when drawing the chart. Defaults to "en" as this is the only language provided in the base installation (see <a href="#optionsLanguage">internationalization</a> below for details on how to add more translations.)</td>
|
|
</tr>
|
|
</table>
|
|
<h3>Layout</h3>
|
|
<p>Most of the look and feel of the Gantt Chart can be controlled using CSS however, as the length of a task bar is determined by column width, the following methods take a single numeric parameter that defines the appropriate column width in pixels.</p>
|
|
<p>Note that the task bar sizing code assumes the use of collapsed table borders 1px wide.</p>
|
|
<table class="configlist">
|
|
<tr>
|
|
<th id="setHourColWidth">setHourColWidth():</th>
|
|
<td>Width of Gantt Chart columns in pixels when drawn in "Hour" format. Defaults to 18.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setDayColWidth">setDayColWidth():</th>
|
|
<td>Width of Gantt Chart columns in pixels when drawn in "Day" format. Defaults to 18.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setWeekColWidth">setWeekColWidth():</th>
|
|
<td>Width of Gantt Chart columns in pixels when drawn in "Week" format. Defaults to 36.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setMonthColWidth">setMonthColWidth():</th>
|
|
<td>Width of Gantt Chart columns in pixels when drawn in "Month" format. Defaults to 36.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setQuarterColWidth">setQuarterColWidth():</th>
|
|
<td>Width of Gantt Chart columns in pixels when drawn in "Quarter" format, although not mandatory it is recommended that this be set to a value divisible by 3. Defaults to 18.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setRowHeight">setRowHeight():</th>
|
|
<td>Height of Gantt Chart rows in pixels. Used to route dependency lines near end points. Defaults to 20.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setMinGpLen">setMinGpLen():</th>
|
|
<td>Group tasks have their task bars embellished with end points, this value specifies the width of one of these end points in pixels. A short task bar's length will be rounded up to display either a single or both endpoints correctly. Defaults to 8.</td>
|
|
</tr>
|
|
</table>
|
|
<h3>Display Date Formats</h3>
|
|
<p>Date display formats can be individually controlled. The methods used to set these display formats each take a single format string parameter. The format string can be made up of the following components (case sensitive)</p>
|
|
<blockquote>
|
|
<table>
|
|
<tr>
|
|
<th>h:</th>
|
|
<td>Hour (1-12)</td>
|
|
</tr>
|
|
<tr>
|
|
<th>hh:</th>
|
|
<td>Hour (01-12)</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pm:</th>
|
|
<td>am/pm indicator</td>
|
|
</tr>
|
|
<tr>
|
|
<th>PM:</th>
|
|
<td>AM/PM indicator</td>
|
|
</tr>
|
|
<tr>
|
|
<th>H:</th>
|
|
<td>Hour (0-23)</td>
|
|
</tr>
|
|
<tr>
|
|
<th>HH:</th>
|
|
<td>Hour (01-23)</td>
|
|
</tr>
|
|
<tr>
|
|
<th>mi:</th>
|
|
<td>Minutes (1-59)</td>
|
|
</tr>
|
|
<tr>
|
|
<th>MI:</th>
|
|
<td>Minutes (01-59)</td>
|
|
</tr>
|
|
<tr>
|
|
<th>d:</th>
|
|
<td>Day (1-31)</td>
|
|
</tr>
|
|
<tr>
|
|
<th>dd:</th>
|
|
<td>Day (01-31)</td>
|
|
</tr>
|
|
<tr>
|
|
<th>day:</th>
|
|
<td>Abbreviated day of week</td>
|
|
</tr>
|
|
<tr>
|
|
<th>DAY:</th>
|
|
<td>Day of week</td>
|
|
</tr>
|
|
<tr>
|
|
<th>m:</th>
|
|
<td>Month (1-12)</td>
|
|
</tr>
|
|
<tr>
|
|
<th>mm:</th>
|
|
<td>Month (01-12)</td>
|
|
</tr>
|
|
<tr>
|
|
<th>mon:</th>
|
|
<td>Abbreviated month text</td>
|
|
</tr>
|
|
<tr>
|
|
<th>month:</th>
|
|
<td>Full month text</td>
|
|
</tr>
|
|
<tr>
|
|
<th>yy:</th>
|
|
<td>Year, excluding century</td>
|
|
</tr>
|
|
<tr>
|
|
<th>yyyy:</th>
|
|
<td>Year</td>
|
|
</tr>
|
|
<tr>
|
|
<th>q:</th>
|
|
<td>Quarter (1-4)</td>
|
|
</tr>
|
|
<tr>
|
|
<th>qq:</th>
|
|
<td>Quarter (Q1-Q4)</td>
|
|
</tr>
|
|
<tr>
|
|
<th>w:</th>
|
|
<td>ISO Week number (1-53)</td>
|
|
</tr>
|
|
<tr>
|
|
<th>ww:</th>
|
|
<td>ISO Week number (01-53)</td>
|
|
</tr>
|
|
<tr>
|
|
<th>week:</th>
|
|
<td>Full ISO Week date format</td>
|
|
</tr>
|
|
</table>
|
|
<p>separated by one of the following characters: <strong>"/\-.,'<space>:</strong></p>
|
|
<p>Any text between separators that does not match one of the components above will be checked using a case insensitive match for a valid internationalized string (see <a href="#optionsLanguage">internationalization</a> below). If the value is still not found the text will be output unchanged.</p>
|
|
</blockquote>
|
|
<p>The available date display methods are</p>
|
|
<table class="dateconfiglist">
|
|
<tr>
|
|
<th id="setDateTaskTableDisplayFormat">setDateTaskTableDisplayFormat():</th>
|
|
<td>Date format used for start and end dates in the main task list. Defaults to 'dd/mm/yyyy'.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setDateTaskDisplayFormat">setDateTaskDisplayFormat():</th>
|
|
<td>Date format used for start and end dates in task tool tips. Defaults to 'dd month yyyy'.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setHourMajorDateDisplayFormat">setHourMajorDateDisplayFormat():</th>
|
|
<td>Date format used for Gantt Chart major date headings displayed in "Hour" format. Defaults to 'day dd month yyyy'.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setDayMajorDateDisplayFormat">setDayMajorDateDisplayFormat():</th>
|
|
<td>Date format used for Gantt Chart major date headings displayed in "Day" format. Defaults to 'dd/mm/yyyy'.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setWeekMajorDateDisplayFormat">setWeekMajorDateDisplayFormat():</th>
|
|
<td>Date format used for Gantt Chart major date headings displayed in "Week" format. Defaults to 'yyyy'.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setMonthMajorDateDisplayFormat">setMonthMajorDateDisplayFormat():</th>
|
|
<td>Date format used for Gantt Chart major date headings displayed in "Month" format. Defaults to 'yyyy'.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setQuarterMajorDateDisplayFormat">setQuarterMajorDateDisplayFormat():</th>
|
|
<td>Date format used for Gantt Chart major date headings displayed in "Year" format. Defaults to 'yyyy'.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setHourMinorDateDisplayFormat">setHourMinorDateDisplayFormat():</th>
|
|
<td>Date format used for Gantt Chart minor date headings displayed in "Hour" format. Defaults to 'HH'.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setDayMinorDateDisplayFormat">setDayMinorDateDisplayFormat():</th>
|
|
<td>Date format used for Gantt Chart minor date headings displayed in "Day" format. Defaults to 'dd'.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setWeekMinjorDateDisplayFormat">setWeekMinjorDateDisplayFormat():</th>
|
|
<td>Date format used for Gantt Chart minor date headings displayed in "Week" format. Defaults to 'dd/mm'.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setMonthMinorDateDisplayFormat">setMonthMinorDateDisplayFormat():</th>
|
|
<td>Date format used for Gantt Chart minor date headings displayed in "Month" format. Defaults to 'mon'.</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="setQuarterMinorDateDisplayFormat">setQuarterMinorDateDisplayFormat():</th>
|
|
<td>Date format used for Gantt Chart minor date headings displayed in "Year" format. Defaults to 'qq'.</td>
|
|
</tr>
|
|
</table>
|
|
<h3 id="optionsLanguage">Internationalization</h3>
|
|
<p>jsGanttImproved only provides English text however all hard coded strings can be replaced by calling the addLang() method available on the GanttChart object returned by a call to JSGantt.GanttChart()</p>
|
|
<p>The addLang() method takes two parameters. The first is a string identifier for the language, the second is a javascript object containing all the replacement text pairs, the default English settings are:</p>
|
|
<blockquote>
|
|
<table class="multipleColumns">
|
|
<tbody>
|
|
<tr>
|
|
<td class="lang">
|
|
<table>
|
|
<tr>
|
|
<th>january:</th>
|
|
<td>January</td>
|
|
</tr>
|
|
<tr>
|
|
<th>february:</th>
|
|
<td>February</td>
|
|
</tr>
|
|
<tr>
|
|
<th>march:</th>
|
|
<td>March</td>
|
|
</tr>
|
|
<tr>
|
|
<th>april:</th>
|
|
<td>April</td>
|
|
</tr>
|
|
<tr>
|
|
<th>maylong:</th>
|
|
<td>May</td>
|
|
</tr>
|
|
<tr>
|
|
<th>june:</th>
|
|
<td>June</td>
|
|
</tr>
|
|
<tr>
|
|
<th>july:</th>
|
|
<td>July</td>
|
|
</tr>
|
|
<tr>
|
|
<th>august:</th>
|
|
<td>August</td>
|
|
</tr>
|
|
<tr>
|
|
<th>september:</th>
|
|
<td>September</td>
|
|
</tr>
|
|
<tr>
|
|
<th>october:</th>
|
|
<td>October</td>
|
|
</tr>
|
|
<tr>
|
|
<th>november:</th>
|
|
<td>November</td>
|
|
</tr>
|
|
<tr>
|
|
<th>december:</th>
|
|
<td>December</td>
|
|
</tr>
|
|
<tr>
|
|
<th>jan:</th>
|
|
<td>Jan</td>
|
|
</tr>
|
|
<tr>
|
|
<th>feb:</th>
|
|
<td>Feb</td>
|
|
</tr>
|
|
<tr>
|
|
<th>mar:</th>
|
|
<td>Mar</td>
|
|
</tr>
|
|
<tr>
|
|
<th>apr:</th>
|
|
<td>Apr</td>
|
|
</tr>
|
|
<tr>
|
|
<th>may:</th>
|
|
<td>May</td>
|
|
</tr>
|
|
<tr>
|
|
<th>jun:</th>
|
|
<td>Jun</td>
|
|
</tr>
|
|
<tr>
|
|
<th>jul:</th>
|
|
<td>Jul</td>
|
|
</tr>
|
|
<tr>
|
|
<th>aug:</th>
|
|
<td>Aug</td>
|
|
</tr>
|
|
<tr>
|
|
<th>sep:</th>
|
|
<td>Sep</td>
|
|
</tr>
|
|
<tr>
|
|
<th>oct:</th>
|
|
<td>Oct</td>
|
|
</tr>
|
|
<tr>
|
|
<th>nov:</th>
|
|
<td>Nov</td>
|
|
</tr>
|
|
<tr>
|
|
<th>dec:</th>
|
|
<td>Dec</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="lang">
|
|
<table>
|
|
<tr>
|
|
<th>sunday:</th>
|
|
<td>Sunday</td>
|
|
</tr>
|
|
<tr>
|
|
<th>monday:</th>
|
|
<td>Monday</td>
|
|
</tr>
|
|
<tr>
|
|
<th>tuesday:</th>
|
|
<td>Tuesday</td>
|
|
</tr>
|
|
<tr>
|
|
<th>wednesday:</th>
|
|
<td>Wednesday</td>
|
|
</tr>
|
|
<tr>
|
|
<th>thursday:</th>
|
|
<td>Thursday</td>
|
|
</tr>
|
|
<tr>
|
|
<th>friday:</th>
|
|
<td>Friday</td>
|
|
</tr>
|
|
<tr>
|
|
<th>saturday:</th>
|
|
<td>Saturday</td>
|
|
</tr>
|
|
<tr>
|
|
<th>sun:</th>
|
|
<td>Sun</td>
|
|
</tr>
|
|
<tr>
|
|
<th>mon:</th>
|
|
<td>Mon</td>
|
|
</tr>
|
|
<tr>
|
|
<th>tue:</th>
|
|
<td>Tue</td>
|
|
</tr>
|
|
<tr>
|
|
<th>wed:</th>
|
|
<td>Wed</td>
|
|
</tr>
|
|
<tr>
|
|
<th>thu:</th>
|
|
<td>Thu</td>
|
|
</tr>
|
|
<tr>
|
|
<th>fri:</th>
|
|
<td>Fri</td>
|
|
</tr>
|
|
<tr>
|
|
<th>sat:</th>
|
|
<td>Sat</td>
|
|
</tr>
|
|
<tr>
|
|
<th>resource:</th>
|
|
<td>Resource</td>
|
|
</tr>
|
|
<tr>
|
|
<th>duration:</th>
|
|
<td>Duration</td>
|
|
</tr>
|
|
<tr>
|
|
<th>comp:</th>
|
|
<td>% Comp.</td>
|
|
</tr>
|
|
<tr>
|
|
<th>completion:</th>
|
|
<td>Completion</td>
|
|
</tr>
|
|
<tr>
|
|
<th>startdate:</th>
|
|
<td>Start Date</td>
|
|
</tr>
|
|
<tr>
|
|
<th>enddate:</th>
|
|
<td>End Date</td>
|
|
</tr>
|
|
<tr>
|
|
<th>moreinfo:</th>
|
|
<td>More Information</td>
|
|
</tr>
|
|
<tr>
|
|
<th>notes:</th>
|
|
<td>Notes</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="lang">
|
|
<table>
|
|
<tr>
|
|
<th>format:</th>
|
|
<td>Format</td>
|
|
</tr>
|
|
<tr>
|
|
<th>hour:</th>
|
|
<td>Hour</td>
|
|
</tr>
|
|
<tr>
|
|
<th>day:</th>
|
|
<td>Day</td>
|
|
</tr>
|
|
<tr>
|
|
<th>week:</th>
|
|
<td>Week</td>
|
|
</tr>
|
|
<tr>
|
|
<th>month:</th>
|
|
<td>Month</td>
|
|
</tr>
|
|
<tr>
|
|
<th>quarter:</th>
|
|
<td>Quarter</td>
|
|
</tr>
|
|
<tr>
|
|
<th>hours:</th>
|
|
<td>Hours</td>
|
|
</tr>
|
|
<tr>
|
|
<th>days:</th>
|
|
<td>Days</td>
|
|
</tr>
|
|
<tr>
|
|
<th>weeks:</th>
|
|
<td>Weeks</td>
|
|
</tr>
|
|
<tr>
|
|
<th>months:</th>
|
|
<td>Months</td>
|
|
</tr>
|
|
<tr>
|
|
<th>quarters:</th>
|
|
<td>Quarters</td>
|
|
</tr>
|
|
<tr>
|
|
<th>hr:</th>
|
|
<td>Hr</td>
|
|
</tr>
|
|
<tr>
|
|
<th>dy:</th>
|
|
<td>Day</td>
|
|
</tr>
|
|
<tr>
|
|
<th>wk:</th>
|
|
<td>Wk</td>
|
|
</tr>
|
|
<tr>
|
|
<th>mth:</th>
|
|
<td>Mth</td>
|
|
</tr>
|
|
<tr>
|
|
<th>qtr:</th>
|
|
<td>Qtr</td>
|
|
</tr>
|
|
<tr>
|
|
<th>hrs:</th>
|
|
<td>Hrs</td>
|
|
</tr>
|
|
<tr>
|
|
<th>dys:</th>
|
|
<td>Days</td>
|
|
</tr>
|
|
<tr>
|
|
<th>wks:</th>
|
|
<td>Wks</td>
|
|
</tr>
|
|
<tr>
|
|
<th>mths:</th>
|
|
<td>Mths</td>
|
|
</tr>
|
|
<tr>
|
|
<th>qtrs:</th>
|
|
<td>Qtrs</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tbody>
|
|
</table>
|
|
</blockquote>
|
|
<p>When adding a language any translations that are not provided will use the default English language value. This provides a simple way to override default strings e.g.</p>
|
|
<pre class="prettyprint lang-js"><code>g.addLang('en2', {'format':'Select', 'comp':'Complete'});</code></pre>
|
|
<p>would create a language called 'en2' where the text in the format selector was "Select" rather than "Format" and the header for the Percentage Complete column in the task list is "Complete" rather than "% Comp."</p>
|
|
<p>Once a translation has been added a call must be made to <a href="#setLang">setLang()</a> with the appropriate langage identifier before calling Draw().</p>
|
|
<h3 id="tOptionsExamples">Example Options</h3>
|
|
<p>The configuration options used in the example chart above are:</p>
|
|
<pre class="prettyprint lang-js"><code>g.setCaptionType('Complete'); // Set to Show Caption (None,Caption,Resource,Duration,Complete)
|
|
g.setQuarterColWidth(36);
|
|
g.setDateTaskDisplayFormat('day dd month yyyy'); // Shown in tool tip box
|
|
g.setDayMajorDateDisplayFormat('mon yyyy - Week ww'); // Set format to display dates in the "Major" header of the "Day" view
|
|
g.setWeekMinorDateDisplayFormat('dd mon'); // Set format to display dates in the "Minor" header of the "Week" view
|
|
g.setShowTaskInfoLink(1); //Show link in tool tip (0/1)
|
|
g.setShowEndWeekDate(0); // Show/Hide the date for the last day of the week in header for daily view (1/0)
|
|
g.setUseSingleCell(10000); // Set the threshold at which we will only use one cell per table row (0 disables). Helps with rendering performance for large charts.
|
|
g.setFormatArr('Day', 'Week', 'Month', 'Quarter'); // Even with setUseSingleCell using Hour format on such a large chart can cause issues in some browsers
|
|
</code></pre>
|
|
<p>Putting all this information together the final code to produce the chart above is as follows:</p>
|
|
<pre class="prettyprint lang-html"><code><link rel="stylesheet" type="text/css" href="jsgantt.css" />
|
|
<script language="javascript" src="jsgantt.js"></script>
|
|
<div style="position:relative" class="gantt" id="GanttChartDIV"></div>
|
|
<script>
|
|
|
|
var g = new JSGantt.GanttChart('g',document.getElementById('GanttChartDIV'), 'day');
|
|
|
|
if( g.getDivId() != null ) {
|
|
g.setCaptionType('Complete');
|
|
g.setQuarterColWidth(36);
|
|
g.setDateTaskDisplayFormat('day dd month yyyy');
|
|
g.setDayMajorDateDisplayFormat('mon yyyy - Week ww');
|
|
g.setWeekMinorDateDisplayFormat('dd mon');
|
|
g.setShowTaskInfoLink(1);
|
|
g.setShowEndWeekDate(0);
|
|
g.setUseSingleCell(10000);
|
|
g.setFormatArr('Day', 'Week', 'Month', 'Quarter');
|
|
|
|
g.AddTaskItem(new JSGantt.TaskItem(1, 'Define Chart API', '', '', 'ggroupblack', '', 0, 'Brian', 0, 1, 0, 1, '', '', 'Some Notes text', g ));
|
|
g.AddTaskItem(new JSGantt.TaskItem(11, 'Chart Object', '2016-02-20','2016-02-20', 'gmilestone', '', 1, 'Shlomy', 100, 0, 1, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(12, 'Task Objects', '', '', 'ggroupblack', '', 0, 'Shlomy', 40, 1, 1, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(121, 'Constructor Proc', '2016-02-21','2016-03-09', 'gtaskblue', '', 0, 'Brian T.', 60, 0, 12, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(122, 'Task Variables', '2016-03-06','2016-03-11', 'gtaskred', '', 0, 'Brian', 60, 0, 12, 1, 121, '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(123, 'Task by Minute/Hour', '2016-03-09','2016-03-14 12:00', 'gtaskyellow', '', 0, 'Ilan', 60, 0, 12, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(124, 'Task Functions', '2016-03-09','2016-03-29', 'gtaskred', '', 0, 'Anyone', 60, 0, 12, 1, '123SS', 'This is a caption', null, g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(2, 'Create HTML Shell', '2016-03-24','2016-03-24', 'gtaskyellow', '', 0, 'Brian', 20, 0, 0, 1, 122, '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(3, 'Code Javascript', '', '', 'ggroupblack', '', 0, 'Brian', 0, 1, 0, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(31, 'Define Variables', '2016-02-25','2016-03-17', 'gtaskpurple', '', 0, 'Brian', 30, 0, 3, 1, '', 'Caption 1','', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(32, 'Calculate Chart Size', '2016-03-15','2016-03-24', 'gtaskgreen', '', 0, 'Shlomy', 40, 0, 3, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(33, 'Draw Task Items', '', '', 'ggroupblack', '', 0, 'Someone', 40, 2, 3, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(332, 'Task Label Table', '2016-03-06','2016-03-09', 'gtaskblue', '', 0, 'Brian', 60, 0, 33, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(333, 'Task Scrolling Grid', '2016-03-11','2016-03-20', 'gtaskblue', '', 0, 'Brian', 0, 0, 33, 1, '332', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(34, 'Draw Task Bars', '', '', 'ggroupblack', '', 0, 'Anybody', 60, 1, 3, 0, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(341, 'Loop each Task', '2016-03-26','2016-04-11', 'gtaskred', '', 0, 'Brian', 60, 0, 34, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(342, 'Calculate Start/Stop', '2016-04-12','2016-05-18', 'gtaskpink', '', 0, 'Brian', 60, 0, 34, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(343, 'Draw Task Div', '2016-05-13','2016-05-17', 'gtaskred', '', 0, 'Brian', 60, 0, 34, 1, '', '', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(344, 'Draw Completion Div', '2016-05-17','2016-06-04', 'gtaskred', '', 0, 'Brian', 60, 0, 34, 1, "342,343",'', '', g));
|
|
g.AddTaskItem(new JSGantt.TaskItem(35, 'Make Updates', '2016-07-17','2017-09-04', 'gtaskpurple', '', 0, 'Brian', 30, 0, 3, 1, '333', '', '', g));
|
|
|
|
g.Draw();
|
|
}
|
|
else
|
|
{
|
|
alert("Error, unable to create Gantt Chart");
|
|
}
|
|
|
|
</script></code></pre>
|
|
<h2 id="xmlExport">XML Export</h2>
|
|
<p>The following methods can be used to extract details of tasks in the project in XML format</p>
|
|
<p>Method definition: <strong>getXMLProject()</strong></p>
|
|
<p>Returns a string containing the entire project in JSGantt Improved XML format. Dates will be exported in the currently defined input format as set by setDateInputFormat()</p>
|
|
<p>Method definition: <strong>getXMLTask(<em>pID, pIdx</em>)</strong></p>
|
|
<table>
|
|
<tr>
|
|
<th>pID:</th>
|
|
<td>(required) the numeric ID that identifies the task to extract</td>
|
|
</tr>
|
|
<tr>
|
|
<th>pIdx:</th>
|
|
<td>(optional) Boolean - if present and set to "true" the number passed in the pID parameter is treated as an array index for the task list rather than an ID</td>
|
|
</tr>
|
|
</table>
|
|
<p>Returns a string containing the specified task item in JSGantt Improved XML format. Dates will be exported in the currently defined input format as set by setDateInputFormat()</p>
|
|
</div>
|
|
<!-- Credits -->
|
|
<div class="container-fluid section" id="credits">
|
|
<h1>Credits</h1>
|
|
<div class="card-group">
|
|
<div class="card contact-card">
|
|
<img class="img-fluid" src="https://avatars.githubusercontent.com/eduardomourar" alt="Eduardo Rodrigues">
|
|
<div class="card-block">
|
|
<h4 class="card-title">Eduardo Rodrigues</h4>
|
|
<p class="card-text">Developer</p>
|
|
<div class="text-right">
|
|
<a href="https://github.com/eduardomourar" class="card-link contact-link"><i class="fa fa-github"></i></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card contact-card">
|
|
<img class="img-fluid" src="https://avatars.githubusercontent.com/RickCardoso" alt="Ricardo Cardoso">
|
|
<div class="card-block">
|
|
<h4 class="card-title">Ricardo Cardoso</h4>
|
|
<p class="card-text">Developer</p>
|
|
<div class="text-right">
|
|
<a href="https://github.com/RickCardoso" class="card-link contact-link"><i class="fa fa-github"></i></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Footer -->
|
|
<div class="footer text-center">
|
|
<p>© Copyright 2013-2017 jsGanttImproved<br />
|
|
Designed with <a href="https://v4-alpha.getbootstrap.com" target="_blank">Bootstrap</a> and <a href="http://fontawesome.io" target="_blank">Font Awesome</a></p>
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|