JSGantt is no longer actively developed - try Twproject Gantt
  jsGantt - 1.2
  Bugs/Issues    Download    License    Usage    Examples    Documenation    Subscribe    Credits




  100% Free Javascript / CSS/ HTML Gantt chart control. Completely buzzword compliant including AJAX !

Resource Duration % Comp. Start Date End Date
    Define Chart API Brian 41 Days 80% 7/20/08 8/29/08
          Chart Object Shlomy - 100% 7/20/08 7/20/08
        Task Objects Shlomy 40 Days 60% 7/21/08 8/29/08
              Constructor Proc Brian T. 20 Days 60% 7/21/08 8/9/08
              Task Variables Brian 6 Days 60% 8/6/08 8/11/08
              Task by Minute/Hour Ilan 7 Days 60% 8/6/08 8/11/08
              Task Functions Anyone 21 Days 60% 8/9/08 8/29/08
      Create HTML Shell Brian 2 Days 20% 8/24/08 8/25/08
    Code Javascript Brian 195 Days 44% 7/25/08 2/4/09
          Define Variables Brian 24 Days 30% 7/25/08 8/17/08
          Calculate Chart Size Shlomy 10 Days 40% 8/15/08 8/24/08
        Draw Taks Items Someone 15 Days 60% 8/6/08 8/20/08
              Task Label Table Brian 6 Days 60% 8/6/08 8/11/08
              Task Scrolling Grid Brian 12 Days 60% 8/9/08 8/20/08
      +  Draw Task Bars Anybody 71 Days 60% 8/26/08 11/4/08
          Make Updates Brian 50 Days 30% 12/17/08 2/4/09
  Powered by jsGantt      Format:DayWeekMonthQuarter
7/13 - 7/19/087/20 - 7/26/087/27 - 8/2/088/3 - 8/9/088/10 - 8/16/088/17 - 8/23/088/24 - 8/30/088/31 - 9/6/089/7 - 9/13/089/14 - 9/20/089/21 - 9/27/089/28 - 10/4/0810/5 - 10/11/0810/12 - 10/18/0810/19 - 10/25/0810/26 - 11/1/0811/2 - 11/8/0811/9 - 11/15/0811/16 - 11/22/0811/23 - 11/29/0811/30 - 12/6/0812/7 - 12/13/0812/14 - 12/20/0812/21 - 12/27/0812/28 - 1/3/091/4 - 1/10/091/11 - 1/17/091/18 - 1/24/091/25 - 1/31/092/1 - 2/7/09
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
Brian
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
Shlomy
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
Shlomy
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
Brian T.
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
Brian
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
Ilan
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
Anyone
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
Brian
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
Brian
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
Brian
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
Shlomy
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
Someone
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
Brian
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
Brian
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
Anybody
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
 
 
  
  
  
  
  
Brian

Basic Features
Advanced Features

  BUGS/ISSUES

Current Issues:
  1. Currently only one gantt chart is allowed per page.

New in 1.2:
  DOWNLOAD
Click here to download the jsgantt
You can download the latest bleeding edge version, request features and report issues at http://code.google.com/p/jsgantt/

  LICENSE
JSGantt is released under BSD license. If you require another license please contact shlomygantz@hotmail.com
If you plan to use it in a commercial product please consider donating the first sale to charity.



  USAGE

1. Include JSGantt CSS and Javascript

<link rel="stylesheet" type="text/css" href="jsgantt.css" />
<script language="javascript" src="jsgantt.js"></script>

2. Create a div element to hold the gantt chart

<div style="position:relative" class="gantt" id="GanttChartDIV"></div>

3. Start a <script> block

<script language="javascript">

4. Instantiate JSGantt using GanttChart()

var g = new JSGantt.GanttChart('g',document.getElementById('GanttChartDIV'), 'day');

    

GanttChart(pGanttVar, pDiv, pFormat)
pGanttVar: (required) name of the variable assigned
pDiv: (required) this is a DIV object created in HTML
pFormat: (required) - used to indicate whether chart should be drawn in "day", "week", "month", or "quarter" format

Customize the look and feel using the following setters

g.setShowRes(1); // Show/Hide Responsible (0/1)
g.setShowDur(1); // Show/Hide Duration (0/1)
g.setShowComp(1); // Show/Hide % Complete(0/1)
g.setCaptionType('Resource');  // Set to Show Caption (None,Caption,Resource,Duration,Complete)
g.setShowStartDate(1); // Show/Hide Start Date(0/1)
g.setShowEndDate(1); // Show/Hide End Date(0/1)
g.setDateInputFormat('mm/dd/yyyy')  // Set format of input dates ('mm/dd/yyyy', 'dd/mm/yyyy', 'yyyy-mm-dd')
g.setDateDisplayFormat('mm/dd/yyyy') // Set format to display dates ('mm/dd/yyyy', 'dd/mm/yyyy', 'yyyy-mm-dd')
g.setFormatArr("day","week","month","quarter") // Set format options (up to 4 : "minute","hour","day","week","month","quarter")

5. Add Tasks using AddTaskItem()

 
g.AddTaskItem(new JSGantt.TaskItem(1,   'Define Chart API',     '',          '',          'ff0000', 'http://google.com', 0, 'Brian',     0, 1, 0, 1));
g.AddTaskItem(new JSGantt.TaskItem(11,  'Chart Object',         '2/10/2008', '2/10/2008', 'ff00ff', 'http://www.yahoo.com', 1, 'Shlomy',  100, 0, 1, 1, "121,122", "My Caption"));
TaskItem(pID, pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend)
pID: (required) is a unique ID used to identify each row for parent functions and for setting dom id for hiding/showing
pName: (required) is the task Label
pStart: (required) the task start date, can enter empty date ('') for groups. You can also enter specific time (2/10/2008 12:00) for additional percision or half days.
pEnd: (required) the task end date, can enter empty date ('') for groups
pColor: (required) the html color for this task; e.g. '00ff00'
pLink: (optional) any http link navigated to when task bar is clicked.
pMile:(optional) represent a milestone
pRes: (optional) resource name
pComp: (required) completion percent
pGroup: (optional) indicates whether this is a group(parent) - 0=NOT Parent; 1=IS Parent
pParent: (required) identifies a parent pID, this causes this task to be a child of identified task
pOpen: can be initially set to close folder when chart is first drawn
pDepend: optional list of id's this task is dependent on ... line drawn from dependent to this item
pCaption: optional caption that will be added after task bar if CaptionType set to "Caption"
*You should be able to add items to the chart in realtime via javascript and issuing "g.Draw()" command.

5a. Another way to add tasks is to use an external XML file with parseXML()

 
JSGantt.parseXML("project.xml",g);
The structure of the XML file:

6. Call Draw() and DrawDependencies()

 

g.Draw();	
g.DrawDependencies();


7. Close the <script> block

</script>


Final code should look like

  ADDITIONAL DEMOS

  SUBSCRIBE

Enter your email address to receive JSGantt announcements


  CREDITS

Developed by Shlomy Gantz and Brian Twidt
Contributed: Paul Labuschagne, Kevin Badgett, Ilan Admon