forked from jsGanttImproved/jsgantt-improved
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1167 lines (1150 loc) · 60.2 KB
/
index.html
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!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>