@syncfusion/ej2-gantt 22.2.12 → 23.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +197 -164
- package/dist/ej2-gantt.min.js +3 -3
- package/dist/ej2-gantt.umd.min.js +3 -3
- package/dist/ej2-gantt.umd.min.js.map +1 -1
- package/dist/es6/ej2-gantt.es2015.js +973 -280
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +1011 -302
- package/dist/es6/ej2-gantt.es5.js.map +1 -1
- package/dist/global/ej2-gantt.min.js +3 -3
- package/dist/global/ej2-gantt.min.js.map +1 -1
- package/dist/global/index.d.ts +2 -2
- package/package.json +21 -21
- package/src/gantt/actions/cell-edit.js +4 -1
- package/src/gantt/actions/connector-line-edit.js +48 -6
- package/src/gantt/actions/critical-path.d.ts +2 -0
- package/src/gantt/actions/critical-path.js +79 -61
- package/src/gantt/actions/dependency.d.ts +1 -0
- package/src/gantt/actions/dependency.js +92 -31
- package/src/gantt/actions/dialog-edit.js +28 -8
- package/src/gantt/actions/edit.js +18 -8
- package/src/gantt/actions/pdf-export.d.ts +4 -1
- package/src/gantt/actions/pdf-export.js +36 -3
- package/src/gantt/actions/rowdragdrop.js +10 -2
- package/src/gantt/actions/selection.js +22 -5
- package/src/gantt/actions/taskbar-edit.js +58 -38
- package/src/gantt/actions/toolbar.js +8 -0
- package/src/gantt/base/date-processor.js +1 -1
- package/src/gantt/base/gantt-chart.d.ts +1 -0
- package/src/gantt/base/gantt-chart.js +85 -6
- package/src/gantt/base/gantt-model.d.ts +7 -0
- package/src/gantt/base/gantt.d.ts +6 -0
- package/src/gantt/base/gantt.js +78 -16
- package/src/gantt/base/interface.d.ts +14 -0
- package/src/gantt/base/splitter.js +1 -0
- package/src/gantt/base/task-processor.d.ts +4 -4
- package/src/gantt/base/task-processor.js +75 -25
- package/src/gantt/base/tree-grid.js +19 -10
- package/src/gantt/export/export-helper.d.ts +5 -1
- package/src/gantt/export/export-helper.js +150 -3
- package/src/gantt/export/pdf-base/pdf-grid-table.js +2 -2
- package/src/gantt/export/pdf-base/pdf-style/gantt-theme.js +8 -0
- package/src/gantt/export/pdf-base/treegrid-layouter.js +3 -1
- package/src/gantt/export/pdf-connector-line.js +3 -1
- package/src/gantt/export/pdf-gantt.js +6 -0
- package/src/gantt/export/pdf-taskbar.d.ts +13 -0
- package/src/gantt/export/pdf-taskbar.js +39 -5
- package/src/gantt/export/pdf-timeline.js +17 -8
- package/src/gantt/export/pdf-treegrid.js +3 -3
- package/src/gantt/models/task-fields-model.d.ts +7 -0
- package/src/gantt/models/task-fields.d.ts +6 -0
- package/src/gantt/models/task-fields.js +3 -0
- package/src/gantt/renderer/chart-rows.d.ts +1 -1
- package/src/gantt/renderer/chart-rows.js +44 -34
- package/src/gantt/renderer/connector-line.js +52 -11
- package/src/gantt/renderer/edit-tooltip.js +2 -1
- package/src/gantt/renderer/timeline.js +16 -9
- package/src/gantt/renderer/tooltip.js +5 -5
- package/styles/bootstrap-dark.css +44 -100
- package/styles/bootstrap.css +44 -100
- package/styles/bootstrap4.css +44 -100
- package/styles/bootstrap5-dark.css +44 -100
- package/styles/bootstrap5.css +44 -100
- package/styles/fabric-dark.css +44 -100
- package/styles/fabric.css +44 -100
- package/styles/fluent-dark.css +44 -100
- package/styles/fluent.css +44 -100
- package/styles/gantt/_layout.scss +44 -31
- package/styles/gantt/_theme.scss +104 -98
- package/styles/gantt/bootstrap-dark.css +44 -100
- package/styles/gantt/bootstrap-dark.scss +1 -1
- package/styles/gantt/bootstrap.css +44 -100
- package/styles/gantt/bootstrap.scss +1 -1
- package/styles/gantt/bootstrap4.css +44 -100
- package/styles/gantt/bootstrap4.scss +1 -1
- package/styles/gantt/bootstrap5-dark.css +44 -100
- package/styles/gantt/bootstrap5-dark.scss +1 -1
- package/styles/gantt/bootstrap5.css +44 -100
- package/styles/gantt/bootstrap5.scss +1 -1
- package/styles/gantt/fabric-dark.css +44 -100
- package/styles/gantt/fabric-dark.scss +1 -1
- package/styles/gantt/fabric.css +44 -100
- package/styles/gantt/fabric.scss +1 -1
- package/styles/gantt/fluent-dark.css +44 -100
- package/styles/gantt/fluent-dark.scss +1 -1
- package/styles/gantt/fluent.css +44 -100
- package/styles/gantt/fluent.scss +1 -1
- package/styles/gantt/highcontrast-light.css +40 -100
- package/styles/gantt/highcontrast-light.scss +1 -1
- package/styles/gantt/highcontrast.css +44 -100
- package/styles/gantt/highcontrast.scss +1 -1
- package/styles/gantt/icons/_bootstrap-dark.scss +4 -0
- package/styles/gantt/icons/_bootstrap.scss +4 -0
- package/styles/gantt/icons/_bootstrap4.scss +4 -0
- package/styles/gantt/icons/_bootstrap5.scss +4 -0
- package/styles/gantt/icons/_fabric-dark.scss +4 -0
- package/styles/gantt/icons/_fabric.scss +4 -0
- package/styles/gantt/icons/_fluent.scss +4 -0
- package/styles/gantt/icons/_fusionnew.scss +4 -0
- package/styles/gantt/icons/_highcontrast.scss +4 -0
- package/styles/gantt/icons/_material-dark.scss +4 -0
- package/styles/gantt/icons/_material.scss +4 -0
- package/styles/gantt/icons/_material3.scss +4 -0
- package/styles/gantt/icons/_tailwind-dark.scss +4 -0
- package/styles/gantt/icons/_tailwind.scss +4 -0
- package/styles/gantt/material-dark.css +44 -101
- package/styles/gantt/material-dark.scss +1 -1
- package/styles/gantt/material.css +44 -101
- package/styles/gantt/material.scss +1 -1
- package/styles/gantt/material3-dark.css +45 -102
- package/styles/gantt/material3-dark.scss +1 -1
- package/styles/gantt/material3.css +45 -102
- package/styles/gantt/material3.scss +1 -1
- package/styles/gantt/tailwind-dark.css +44 -101
- package/styles/gantt/tailwind-dark.scss +1 -1
- package/styles/gantt/tailwind.css +44 -101
- package/styles/gantt/tailwind.scss +1 -1
- package/styles/highcontrast-light.css +40 -100
- package/styles/highcontrast.css +44 -100
- package/styles/material-dark.css +44 -101
- package/styles/material.css +44 -101
- package/styles/material3-dark.css +45 -102
- package/styles/material3-dark.scss +1 -1
- package/styles/material3.css +45 -102
- package/styles/material3.scss +1 -1
- package/styles/tailwind-dark.css +44 -101
- package/styles/tailwind.css +44 -101
|
@@ -117,6 +117,11 @@ var GanttTreeGrid = /** @class */ (function () {
|
|
|
117
117
|
this.wireEvents();
|
|
118
118
|
};
|
|
119
119
|
GanttTreeGrid.prototype.composeProperties = function () {
|
|
120
|
+
this.parent.treeGrid.hasChildMapping = this.parent.taskFields.hasChildMapping;
|
|
121
|
+
this.parent.treeGrid.loadChildOnDemand = this.parent.loadChildOnDemand;
|
|
122
|
+
this.parent.treeGrid['isFromGantt'] = true;
|
|
123
|
+
this.parent.treeGrid.parentIdMapping = this.parent.taskFields.parentID;
|
|
124
|
+
this.parent.treeGrid.idMapping = this.parent.taskFields.id;
|
|
120
125
|
this.parent.treeGrid.showColumnMenu = this.parent.showColumnMenu;
|
|
121
126
|
this.parent.treeGrid.enableCollapseAll = this.parent.collapseAllParentTasks;
|
|
122
127
|
this.parent.treeGrid.columnMenuItems = this.parent.columnMenuItems;
|
|
@@ -133,8 +138,14 @@ var GanttTreeGrid = /** @class */ (function () {
|
|
|
133
138
|
this.parent.treeGrid.dataSource = { result: this.parent.flatData, count: count };
|
|
134
139
|
}
|
|
135
140
|
else {
|
|
136
|
-
this.parent.treeGrid.hasChildMapping
|
|
137
|
-
|
|
141
|
+
if (!this.parent.treeGrid.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
142
|
+
this.parent.autoCalculateDateScheduling = false;
|
|
143
|
+
this.parent.treeGrid.dataSource = this.parent.dataSource;
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
this.parent.treeGrid.hasChildMapping = null;
|
|
147
|
+
this.parent.treeGrid.dataSource = this.parent.flatData;
|
|
148
|
+
}
|
|
138
149
|
}
|
|
139
150
|
this.parent.treeGrid.expandStateMapping = this.parent.taskFields.expandState;
|
|
140
151
|
var isGantt = 'isGantt';
|
|
@@ -295,7 +306,7 @@ var GanttTreeGrid = /** @class */ (function () {
|
|
|
295
306
|
collapsedArgs = this.createExpandCollapseArgs(args, null);
|
|
296
307
|
this.parent.ganttChartModule.collapsedGanttRow(collapsedArgs);
|
|
297
308
|
}
|
|
298
|
-
if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && collapsedArgs['gridRow']) {
|
|
309
|
+
if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && !this.parent.ganttChartModule.isCollapseAll && collapsedArgs['gridRow']) {
|
|
299
310
|
collapsedArgs['gridRow'].style.height = collapsedArgs['chartRow'].style.height;
|
|
300
311
|
this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
|
|
301
312
|
this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
|
|
@@ -325,7 +336,7 @@ var GanttTreeGrid = /** @class */ (function () {
|
|
|
325
336
|
expandedArgs = this.createExpandCollapseArgs(args, null);
|
|
326
337
|
this.parent.ganttChartModule.expandedGanttRow(expandedArgs);
|
|
327
338
|
}
|
|
328
|
-
if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && args['row']) {
|
|
339
|
+
if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && !this.parent.ganttChartModule.isExpandAll && args['row']) {
|
|
329
340
|
args['row'].style.height = this.parent.rowHeight + 'px';
|
|
330
341
|
this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
|
|
331
342
|
this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
|
|
@@ -895,6 +906,9 @@ var GanttTreeGrid = /** @class */ (function () {
|
|
|
895
906
|
if (!isNullOrUndefined(ganttProp)) {
|
|
896
907
|
return this.parent.dataOperation.getDurationString(ganttProp.duration, ganttProp.durationUnit);
|
|
897
908
|
}
|
|
909
|
+
else if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
910
|
+
return this.parent.dataOperation.getDurationString(parseInt(data[this.parent.taskFields.duration]), this.parent.durationUnit);
|
|
911
|
+
}
|
|
898
912
|
return '';
|
|
899
913
|
}; // eslint-disable-next-line
|
|
900
914
|
GanttTreeGrid.prototype.resourceValueAccessor = function (field, data, column) {
|
|
@@ -931,12 +945,7 @@ var GanttTreeGrid = /** @class */ (function () {
|
|
|
931
945
|
};
|
|
932
946
|
GanttTreeGrid.prototype.updateScrollTop = function (args) {
|
|
933
947
|
var newScrollTop;
|
|
934
|
-
|
|
935
|
-
newScrollTop = getValue('top', args) - document.getElementsByClassName('e-chart-scroll-container e-content')[0]['offsetHeight'];
|
|
936
|
-
}
|
|
937
|
-
else {
|
|
938
|
-
newScrollTop = getValue('top', args);
|
|
939
|
-
}
|
|
948
|
+
newScrollTop = getValue('top', args);
|
|
940
949
|
this.treeGridElement.querySelector('.e-content').scrollTop = newScrollTop;
|
|
941
950
|
this.previousScroll.top = this.treeGridElement.querySelector('.e-content').scrollTop;
|
|
942
951
|
};
|
|
@@ -9,7 +9,7 @@ import { Gantt } from './../base/gantt';
|
|
|
9
9
|
export declare class ExportHelper {
|
|
10
10
|
private parent;
|
|
11
11
|
private flatData;
|
|
12
|
-
|
|
12
|
+
exportProps: PdfExportProperties;
|
|
13
13
|
private gantt;
|
|
14
14
|
private rowIndex;
|
|
15
15
|
private colIndex;
|
|
@@ -19,7 +19,11 @@ export declare class ExportHelper {
|
|
|
19
19
|
private pdfDoc;
|
|
20
20
|
private exportValueFormatter;
|
|
21
21
|
private totalColumnWidth;
|
|
22
|
+
beforeSinglePageExport: Object;
|
|
23
|
+
baselineHeight: number;
|
|
24
|
+
baselineTop: number;
|
|
22
25
|
constructor(parent: Gantt);
|
|
26
|
+
processToFit(): void;
|
|
23
27
|
/**
|
|
24
28
|
* @param {IGanttData[]} data .
|
|
25
29
|
* @param {PdfGantt} gantt .
|
|
@@ -13,8 +13,101 @@ import { pixelToPoint, isScheduledTask } from '../base/utils';
|
|
|
13
13
|
*/
|
|
14
14
|
var ExportHelper = /** @class */ (function () {
|
|
15
15
|
function ExportHelper(parent) {
|
|
16
|
+
this.totalColumnWidth = 0;
|
|
17
|
+
this.beforeSinglePageExport = {};
|
|
18
|
+
this.baselineHeight = 8;
|
|
16
19
|
this.parent = parent;
|
|
17
20
|
}
|
|
21
|
+
ExportHelper.prototype.processToFit = function () {
|
|
22
|
+
this.beforeSinglePageExport['zoomingProjectStartDate'] = this.parent.zoomingProjectStartDate;
|
|
23
|
+
this.beforeSinglePageExport['zoomingProjectEndDate'] = this.parent.zoomingProjectEndDate;
|
|
24
|
+
this.beforeSinglePageExport['cloneProjectStartDate'] = this.parent.cloneProjectStartDate;
|
|
25
|
+
this.beforeSinglePageExport['cloneProjectEndDate'] = this.parent.cloneProjectEndDate;
|
|
26
|
+
this.beforeSinglePageExport['customTimelineSettings'] = extend({}, this.parent.timelineModule.customTimelineSettings, null, true);
|
|
27
|
+
this.beforeSinglePageExport['isTimelineRoundOff'] = this.parent.isTimelineRoundOff;
|
|
28
|
+
this.beforeSinglePageExport['topTier'] = this.parent.timelineModule.topTier;
|
|
29
|
+
this.beforeSinglePageExport['topTierCellWidth'] = this.parent.timelineModule.topTierCellWidth;
|
|
30
|
+
this.beforeSinglePageExport['topTierCollection'] = this.parent.timelineModule.topTierCollection;
|
|
31
|
+
this.beforeSinglePageExport['bottomTier'] = this.parent.timelineModule.bottomTier;
|
|
32
|
+
this.beforeSinglePageExport['bottomTierCellWidth'] = this.parent.timelineModule.bottomTierCellWidth;
|
|
33
|
+
this.beforeSinglePageExport['bottomTierCollection'] = this.parent.timelineModule.bottomTierCollection;
|
|
34
|
+
this.beforeSinglePageExport['totalTimelineWidth'] = this.parent.timelineModule.totalTimelineWidth;
|
|
35
|
+
this.beforeSinglePageExport['timelineStartDate'] = this.parent.timelineModule.timelineStartDate;
|
|
36
|
+
this.beforeSinglePageExport['timelineEndDate'] = this.parent.timelineModule.timelineEndDate;
|
|
37
|
+
this.beforeSinglePageExport['timelineRoundOffEndDate'] = this.parent.timelineModule.timelineRoundOffEndDate;
|
|
38
|
+
this.beforeSinglePageExport['perDayWidth'] = this.parent.perDayWidth;
|
|
39
|
+
this.beforeSinglePageExport['updatedConnectorLineCollection'] = extend([], this.parent.updatedConnectorLineCollection, null, true);
|
|
40
|
+
this.parent.timelineModule.isZoomToFit = true;
|
|
41
|
+
this.parent.timelineModule.isZooming = false;
|
|
42
|
+
if (!this.parent.zoomingProjectStartDate) {
|
|
43
|
+
this.parent.zoomingProjectStartDate = this.parent.cloneProjectStartDate;
|
|
44
|
+
this.parent.zoomingProjectEndDate = this.parent.cloneProjectEndDate;
|
|
45
|
+
}
|
|
46
|
+
if (this.parent.zoomingProjectStartDate > this.parent.cloneProjectStartDate) {
|
|
47
|
+
this.parent.cloneProjectStartDate = new Date(this.parent.allowUnscheduledTasks ? this.parent.zoomingProjectStartDate : this.parent.cloneProjectStartDate);
|
|
48
|
+
}
|
|
49
|
+
this.parent.dataOperation.calculateProjectDates();
|
|
50
|
+
var timeDifference = (this.parent.cloneProjectEndDate.getTime() - this.parent.cloneProjectStartDate.getTime());
|
|
51
|
+
var totalDays = (timeDifference / (1000 * 3600 * 24));
|
|
52
|
+
var chartsideWidth;
|
|
53
|
+
var gridWidth;
|
|
54
|
+
if (this.exportProps.fitToWidthSettings.gridWidth) {
|
|
55
|
+
gridWidth = parseInt(this.exportProps.fitToWidthSettings.gridWidth.split('%')[0]);
|
|
56
|
+
}
|
|
57
|
+
if (this.exportProps.fitToWidthSettings.chartWidth) {
|
|
58
|
+
chartsideWidth = parseInt(this.exportProps.fitToWidthSettings.chartWidth.split('%')[0]);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
if (this.exportProps.fitToWidthSettings.gridWidth) {
|
|
62
|
+
chartsideWidth = 100 - gridWidth;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
chartsideWidth = 70;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
var pdfwidth = (this.parent.pdfExportModule['pdfPageDimensions'].width * chartsideWidth) / 100;
|
|
69
|
+
var chartWidth = pdfwidth;
|
|
70
|
+
var perDayWidth = chartWidth / totalDays;
|
|
71
|
+
var zoomingLevel;
|
|
72
|
+
var firstValue;
|
|
73
|
+
var secondValue;
|
|
74
|
+
var zoomingCollections = this.parent.zoomingLevels.slice();
|
|
75
|
+
var sortedCollectons = zoomingCollections.sort(function (a, b) {
|
|
76
|
+
return (!a.perDayWidth && !b.perDayWidth ? 0 : (a.perDayWidth < b.perDayWidth) ? 1 : -1);
|
|
77
|
+
});
|
|
78
|
+
if (perDayWidth === 0) { // return when the Gantt chart is not in viewable state.
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
for (var i = 0; i < sortedCollectons.length; i++) {
|
|
82
|
+
firstValue = sortedCollectons[i];
|
|
83
|
+
if (i === sortedCollectons.length - 1) {
|
|
84
|
+
zoomingLevel = sortedCollectons[i];
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
secondValue = sortedCollectons[i + 1];
|
|
89
|
+
}
|
|
90
|
+
if (perDayWidth >= firstValue.perDayWidth) {
|
|
91
|
+
zoomingLevel = sortedCollectons[i];
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
if (perDayWidth < firstValue.perDayWidth && perDayWidth > secondValue.perDayWidth) {
|
|
95
|
+
zoomingLevel = sortedCollectons[i + 1];
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
var newTimeline = extend({}, {}, zoomingLevel, true);
|
|
100
|
+
this.parent.timelineModule['roundOffDateToZoom'](this.parent.cloneProjectStartDate, true, perDayWidth, newTimeline.bottomTier.unit, zoomingLevel);
|
|
101
|
+
this.parent.timelineModule['roundOffDateToZoom'](this.parent.cloneProjectEndDate, false, perDayWidth, newTimeline.bottomTier.unit, zoomingLevel);
|
|
102
|
+
var numberOfCells = this.parent.timelineModule['calculateNumberOfTimelineCells'](newTimeline);
|
|
103
|
+
var scrollHeight = this.parent.pdfExportModule['pdfPageDimensions'].height; //17 is horizontal scrollbar width
|
|
104
|
+
var contentHeight = this.parent.pdfExportModule['pdfPageDimensions'].height;
|
|
105
|
+
var emptySpace = contentHeight <= scrollHeight ? 0 : 17;
|
|
106
|
+
newTimeline.timelineUnitSize = Math.abs((chartWidth - emptySpace)) / numberOfCells;
|
|
107
|
+
this.parent.timelineModule['changeTimelineSettings'](newTimeline);
|
|
108
|
+
this.parent.timelineModule.isZoomToFit = false;
|
|
109
|
+
this.parent.timelineModule.isZooming = false;
|
|
110
|
+
};
|
|
18
111
|
/**
|
|
19
112
|
* @param {IGanttData[]} data .
|
|
20
113
|
* @param {PdfGantt} gantt .
|
|
@@ -36,11 +129,16 @@ var ExportHelper = /** @class */ (function () {
|
|
|
36
129
|
this.gantt.style.cellPadding.right = 0;
|
|
37
130
|
this.ganttStyle = this.gantt.ganttStyle;
|
|
38
131
|
this.gantt.borderColor = this.ganttStyle.chartGridLineColor;
|
|
132
|
+
this.parent.pdfExportModule.isPdfExport = true;
|
|
133
|
+
if (this.exportProps.fitToWidthSettings && this.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
134
|
+
this.processToFit();
|
|
135
|
+
}
|
|
39
136
|
this.processHeaderContent();
|
|
40
137
|
this.processGanttContent();
|
|
41
138
|
this.processTimeline();
|
|
42
139
|
this.processTaskbar();
|
|
43
140
|
this.processPredecessor();
|
|
141
|
+
this.parent.pdfExportModule.isPdfExport = false;
|
|
44
142
|
};
|
|
45
143
|
ExportHelper.prototype.processHeaderContent = function () {
|
|
46
144
|
var _this = this;
|
|
@@ -96,7 +194,9 @@ var ExportHelper = /** @class */ (function () {
|
|
|
96
194
|
this.renderEmptyGantt();
|
|
97
195
|
}
|
|
98
196
|
else {
|
|
99
|
-
|
|
197
|
+
var flatData = void 0;
|
|
198
|
+
flatData = this.flatData;
|
|
199
|
+
flatData.forEach(function (data) {
|
|
100
200
|
_this.row = _this.gantt.rows.addRow();
|
|
101
201
|
if (data.hasChildRecords) {
|
|
102
202
|
_this.gantt.rows.getRow(_this.rowIndex).isParentRow = true;
|
|
@@ -105,6 +205,9 @@ var ExportHelper = /** @class */ (function () {
|
|
|
105
205
|
else {
|
|
106
206
|
_this.processRecordRow(data);
|
|
107
207
|
}
|
|
208
|
+
if (_this.exportProps.fitToWidthSettings && _this.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
209
|
+
_this.row.height = 33.33;
|
|
210
|
+
}
|
|
108
211
|
_this.rowIndex++;
|
|
109
212
|
});
|
|
110
213
|
}
|
|
@@ -156,7 +259,7 @@ var ExportHelper = /** @class */ (function () {
|
|
|
156
259
|
else {
|
|
157
260
|
predecessor.connectorLineColor = _this.ganttStyle.connectorLineColor;
|
|
158
261
|
}
|
|
159
|
-
|
|
262
|
+
_this.ganttStyle.connectorLineColor = predecessor.connectorLineColor;
|
|
160
263
|
_this.gantt.predecessorCollection.push(predecessor);
|
|
161
264
|
});
|
|
162
265
|
this.parent.pdfExportModule.isPdfExport = false;
|
|
@@ -221,7 +324,9 @@ var ExportHelper = /** @class */ (function () {
|
|
|
221
324
|
*/
|
|
222
325
|
ExportHelper.prototype.processTaskbar = function () {
|
|
223
326
|
var _this = this;
|
|
224
|
-
|
|
327
|
+
var flatData;
|
|
328
|
+
flatData = this.flatData;
|
|
329
|
+
flatData.forEach(function (data) {
|
|
225
330
|
var taskbar = _this.gantt.taskbar.add();
|
|
226
331
|
var ganttProp = data.ganttProperties;
|
|
227
332
|
taskbar.left = ganttProp.left;
|
|
@@ -252,7 +357,22 @@ var ExportHelper = /** @class */ (function () {
|
|
|
252
357
|
taskbar.startDate = ganttProp.startDate;
|
|
253
358
|
taskbar.endDate = ganttProp.endDate;
|
|
254
359
|
taskbar.height = _this.parent.chartRowsModule.taskBarHeight;
|
|
360
|
+
if (_this.parent.renderBaseline) {
|
|
361
|
+
var height = void 0;
|
|
362
|
+
if ((taskbar.height + _this.baselineHeight) <= _this.parent.rowHeight) {
|
|
363
|
+
height = taskbar.height;
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
height = taskbar.height - (_this.baselineHeight + 1);
|
|
367
|
+
}
|
|
368
|
+
taskbar.height = height;
|
|
369
|
+
}
|
|
370
|
+
taskbar.baselineTop = _this.parent.chartRowsModule.baselineTop;
|
|
255
371
|
taskbar.isMilestone = ganttProp.isMilestone;
|
|
372
|
+
taskbar.baselineStartDate = ganttProp.baselineStartDate;
|
|
373
|
+
taskbar.baselineEndDate = ganttProp.baselineEndDate;
|
|
374
|
+
taskbar.baselineLeft = ganttProp.baselineLeft;
|
|
375
|
+
taskbar.baselineWidth = ganttProp.baselineWidth;
|
|
256
376
|
taskbar.milestoneColor = new PdfColor(_this.ganttStyle.taskbar.milestoneColor);
|
|
257
377
|
taskbar.isParentTask = data.hasChildRecords;
|
|
258
378
|
if (ganttProp.isMilestone) {
|
|
@@ -283,6 +403,7 @@ var ExportHelper = /** @class */ (function () {
|
|
|
283
403
|
taskbar.taskColor = new PdfColor(_this.ganttStyle.taskbar.criticalTaskColor);
|
|
284
404
|
taskbar.progressColor = new PdfColor(_this.ganttStyle.taskbar.criticalProgressColor);
|
|
285
405
|
taskbar.taskBorderColor = new PdfColor(_this.ganttStyle.taskbar.criticalTaskBorderColor);
|
|
406
|
+
taskbar.milestoneColor = new PdfColor(_this.ganttStyle.taskbar.criticalTaskColor);
|
|
286
407
|
}
|
|
287
408
|
else {
|
|
288
409
|
taskbar.taskColor = new PdfColor(_this.ganttStyle.taskbar.taskColor);
|
|
@@ -290,6 +411,8 @@ var ExportHelper = /** @class */ (function () {
|
|
|
290
411
|
taskbar.taskBorderColor = new PdfColor(_this.ganttStyle.taskbar.taskBorderColor);
|
|
291
412
|
}
|
|
292
413
|
}
|
|
414
|
+
taskbar.baselineColor = new PdfColor(_this.ganttStyle.taskbar.baselineColor);
|
|
415
|
+
taskbar.baselineBorderColor = new PdfColor(_this.ganttStyle.taskbar.baselineBorderColor);
|
|
293
416
|
taskbar.gridLineColor = new PdfColor(_this.ganttStyle.chartGridLineColor);
|
|
294
417
|
_this.gantt.taskbarCollection.push(taskbar);
|
|
295
418
|
var taskStyle = {};
|
|
@@ -298,6 +421,8 @@ var ExportHelper = /** @class */ (function () {
|
|
|
298
421
|
taskStyle.taskBorderColor = taskbar.taskBorderColor;
|
|
299
422
|
taskStyle.progressColor = taskbar.progressColor;
|
|
300
423
|
taskStyle.milestoneColor = taskbar.milestoneColor;
|
|
424
|
+
taskStyle.baselineColor = taskbar.baselineColor;
|
|
425
|
+
taskStyle.baselineBorderColor = taskbar.baselineBorderColor;
|
|
301
426
|
var args = {
|
|
302
427
|
taskbar: taskStyle,
|
|
303
428
|
data: data
|
|
@@ -309,6 +434,8 @@ var ExportHelper = /** @class */ (function () {
|
|
|
309
434
|
taskbar.taskBorderColor = args.taskbar.taskBorderColor;
|
|
310
435
|
taskbar.progressColor = args.taskbar.progressColor;
|
|
311
436
|
taskbar.milestoneColor = args.taskbar.milestoneColor;
|
|
437
|
+
taskbar.baselineColor = args.taskbar.baselineColor;
|
|
438
|
+
taskbar.baselineBorderColor = args.taskbar.baselineBorderColor;
|
|
312
439
|
}
|
|
313
440
|
});
|
|
314
441
|
};
|
|
@@ -456,6 +583,26 @@ var ExportHelper = /** @class */ (function () {
|
|
|
456
583
|
var widths = [];
|
|
457
584
|
var treeColumnIndex = 0;
|
|
458
585
|
var tWidth = (this.pdfDoc.pageSettings.width - 82);
|
|
586
|
+
if (this.exportProps && this.exportProps.fitToWidthSettings && this.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
587
|
+
var gridWidth = void 0;
|
|
588
|
+
if (this.exportProps.fitToWidthSettings.gridWidth) {
|
|
589
|
+
gridWidth = parseInt(this.exportProps.fitToWidthSettings.gridWidth.split('%')[0]);
|
|
590
|
+
}
|
|
591
|
+
else {
|
|
592
|
+
if (this.exportProps.fitToWidthSettings.chartWidth) {
|
|
593
|
+
var chartWidth = parseInt(this.exportProps.fitToWidthSettings.chartWidth.split('%')[0]);
|
|
594
|
+
gridWidth = 100 - chartWidth;
|
|
595
|
+
}
|
|
596
|
+
else {
|
|
597
|
+
gridWidth = 30;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
var pdfwidth = (this.parent.pdfExportModule['pdfPageDimensions'].width * gridWidth) / 100;
|
|
601
|
+
var perColumnWidth = pdfwidth / this.gantt.columns.columns.length;
|
|
602
|
+
for (var i = 0; i < this.gantt.columns.columns.length; i++) {
|
|
603
|
+
this.gantt.columns.getColumn(i).width = perColumnWidth;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
459
606
|
if (this.totalColumnWidth > (this.pdfDoc.pageSettings.width - 82)) {
|
|
460
607
|
this.gantt.style.allowHorizontalOverflow = true;
|
|
461
608
|
}
|
|
@@ -196,11 +196,11 @@ var PdfTreeGridCell = /** @class */ (function () {
|
|
|
196
196
|
if (this.finishedDrawingCell) {
|
|
197
197
|
temp = (this.remainingString === '') ? this.remainingString : this.value;
|
|
198
198
|
/* eslint-disable-next-line */
|
|
199
|
-
graphics.drawString(temp, font, textPen, textBrush, (innerLayoutArea.x + leftAdjustment), innerLayoutArea.y, (innerLayoutArea.width - leftAdjustment - padding), (innerLayoutArea.height - padding), this.style.format);
|
|
199
|
+
graphics.drawString(temp, font, textPen, textBrush, (innerLayoutArea.x + leftAdjustment), this.isHeaderCell ? innerLayoutArea.y - 16 : innerLayoutArea.y, (innerLayoutArea.width - leftAdjustment - padding), (innerLayoutArea.height - padding), this.style.format);
|
|
200
200
|
}
|
|
201
201
|
else {
|
|
202
202
|
/* eslint-disable-next-line */
|
|
203
|
-
graphics.drawString(this.remainingString, font, textPen, textBrush, (innerLayoutArea.x + leftAdjustment), innerLayoutArea.y, this.style.format);
|
|
203
|
+
graphics.drawString(this.remainingString, font, textPen, textBrush, (innerLayoutArea.x + leftAdjustment), this.isHeaderCell ? innerLayoutArea.y - 16 : innerLayoutArea.y, this.style.format);
|
|
204
204
|
}
|
|
205
205
|
result = graphics.stringLayoutResult;
|
|
206
206
|
}
|
|
@@ -55,6 +55,8 @@ var PdfGanttTheme = /** @class */ (function () {
|
|
|
55
55
|
ganttStyle.taskbar.progressColor = new PdfColor(33, 82, 125);
|
|
56
56
|
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
57
57
|
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
58
|
+
ganttStyle.taskbar.baselineColor = new PdfColor(240, 173, 78);
|
|
59
|
+
ganttStyle.taskbar.baselineBorderColor = new PdfColor(240, 173, 78);
|
|
58
60
|
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
59
61
|
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
60
62
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(119, 119, 119);
|
|
@@ -75,6 +77,8 @@ var PdfGanttTheme = /** @class */ (function () {
|
|
|
75
77
|
ganttStyle.taskbar.progressColor = new PdfColor(0, 86, 179);
|
|
76
78
|
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
77
79
|
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
80
|
+
ganttStyle.taskbar.baselineColor = new PdfColor(255, 193, 7);
|
|
81
|
+
ganttStyle.taskbar.baselineBorderColor = new PdfColor(255, 193, 7);
|
|
78
82
|
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
79
83
|
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
80
84
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(108, 117, 125);
|
|
@@ -97,6 +101,8 @@ var PdfGanttTheme = /** @class */ (function () {
|
|
|
97
101
|
ganttStyle.taskbar.progressColor = new PdfColor(0, 91, 163);
|
|
98
102
|
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
99
103
|
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
104
|
+
ganttStyle.taskbar.baselineColor = new PdfColor(216, 59, 1);
|
|
105
|
+
ganttStyle.taskbar.baselineBorderColor = new PdfColor(216, 59, 1);
|
|
100
106
|
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
101
107
|
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
102
108
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(118, 118, 118);
|
|
@@ -117,6 +123,8 @@ var PdfGanttTheme = /** @class */ (function () {
|
|
|
117
123
|
ganttStyle.taskbar.progressColor = new PdfColor(63, 81, 181);
|
|
118
124
|
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
119
125
|
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
126
|
+
ganttStyle.taskbar.baselineColor = new PdfColor(193, 87, 0);
|
|
127
|
+
ganttStyle.taskbar.baselineBorderColor = new PdfColor(193, 87, 0);
|
|
120
128
|
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
121
129
|
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
122
130
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(132, 132, 132);
|
|
@@ -16,6 +16,7 @@ import { PdfBorders, TemporaryDictionary } from './index';
|
|
|
16
16
|
import { PdfHorizontalOverflowType } from '../../base/interface';
|
|
17
17
|
import { ElementLayouter, PdfLayoutResult, PdfLayoutFormat, SizeF, PointF, RectangleF, RowLayoutResult, PdfLayoutType, PdfLayoutBreakType } from '@syncfusion/ej2-pdf-export';
|
|
18
18
|
import { PdfStringFormat } from '@syncfusion/ej2-pdf-export';
|
|
19
|
+
import { pointToPixel } from '../../base/utils';
|
|
19
20
|
/**
|
|
20
21
|
*
|
|
21
22
|
*/
|
|
@@ -83,7 +84,7 @@ var PdfTreeGridLayouter = /** @class */ (function (_super) {
|
|
|
83
84
|
var startColumn = 0;
|
|
84
85
|
var endColumn = 0;
|
|
85
86
|
var cellWidths = 0;
|
|
86
|
-
var availableWidth = this.currentGraphics.clientSize.width - this.currentBounds.x;
|
|
87
|
+
var availableWidth = pointToPixel(this.currentGraphics.clientSize.width) - this.currentBounds.x;
|
|
87
88
|
for (var i = 0; i < this.treegrid.columns.count; i++) {
|
|
88
89
|
cellWidths += this.treegrid.columns.getColumn(i).width;
|
|
89
90
|
if (cellWidths >= availableWidth) {
|
|
@@ -311,6 +312,7 @@ var PdfTreeGridLayouter = /** @class */ (function (_super) {
|
|
|
311
312
|
var size = new SizeF(column.width, height);
|
|
312
313
|
if (cell.columnSpan > 1) {
|
|
313
314
|
size = new SizeF(cell.width, height);
|
|
315
|
+
i += cell.columnSpan;
|
|
314
316
|
}
|
|
315
317
|
if (!this.checkIfDefaultFormat(column.format) && this.checkIfDefaultFormat(cell.style.format)) {
|
|
316
318
|
cell.style.format = column.format;
|
|
@@ -163,7 +163,9 @@ var PdfGanttPredecessor = /** @class */ (function () {
|
|
|
163
163
|
}
|
|
164
164
|
break;
|
|
165
165
|
}
|
|
166
|
-
var
|
|
166
|
+
var midPointforTaskbar = Math.round((this.parent.rowHeight - 1) / 2.0);
|
|
167
|
+
var midPointforBaseline = Math.round((this.parent.rowHeight - 10) / 2.0);
|
|
168
|
+
var midPoint = this.parent.renderBaseline ? midPointforBaseline : midPointforTaskbar;
|
|
167
169
|
midPoint = pixelToPoint(midPoint);
|
|
168
170
|
/* eslint-disable-next-line */
|
|
169
171
|
var point1, point2, point3, point4, point5, point6;
|
|
@@ -221,6 +221,7 @@ var PdfGantt = /** @class */ (function (_super) {
|
|
|
221
221
|
var pageData;
|
|
222
222
|
this.headerDetails.forEach(function (detail, index) {
|
|
223
223
|
var page = _this.result.page.section.getPages()[_this.startPageIndex];
|
|
224
|
+
page['contentWidth'] = pointToPixel(_this.headerDetails[index].endPoint - _this.headerDetails[index].startPoint);
|
|
224
225
|
_this.chartHeader.drawTimeline(page, _this.startPoint, detail);
|
|
225
226
|
taskbarPoint.y = taskbarPoint.y + pixelToPoint(_this.parent.timelineModule.isSingleTier ? 45 : 60); // headerHeight
|
|
226
227
|
pageStartX = taskbarPoint.x;
|
|
@@ -231,6 +232,11 @@ var PdfGantt = /** @class */ (function (_super) {
|
|
|
231
232
|
var task = _this.taskbarCollection[i];
|
|
232
233
|
var rowHeight = _this.rows.getRow(i + 1).height;
|
|
233
234
|
var pdfPage = _this.result.page.section.getPages()[_this.startPageIndex];
|
|
235
|
+
var graphics = pdfPage.graphics;
|
|
236
|
+
var pen = new PdfPen(new PdfColor(206, 206, 206));
|
|
237
|
+
if (page['contentWidth'] && (_this.parent.gridLines == "Both" || _this.parent.gridLines == "Horizontal")) {
|
|
238
|
+
graphics.drawRectangle(pen, pageStartX, taskbarPoint.y, page['contentWidth'] + 0.5, rowHeight);
|
|
239
|
+
}
|
|
234
240
|
/* eslint-disable-next-line */
|
|
235
241
|
var isNextPage = task.drawTaskbar(pdfPage, taskbarPoint, detail, cumulativeWidth, rowHeight, _this.taskbarCollection[i]);
|
|
236
242
|
if (isNextPage) {
|
|
@@ -14,6 +14,16 @@ export declare class PdfGanttTaskbarCollection {
|
|
|
14
14
|
isAutoSchedule?: boolean;
|
|
15
15
|
/** Defines the task is milestone or not. */
|
|
16
16
|
isMilestone?: boolean;
|
|
17
|
+
/** Defines the task baselinestartdate. */
|
|
18
|
+
baselineStartDate?: Date;
|
|
19
|
+
/** Defines the task baselineenddate. */
|
|
20
|
+
baselineEndDate?: Date;
|
|
21
|
+
/** Defines the task baselineleft. */
|
|
22
|
+
baselineLeft?: number;
|
|
23
|
+
/** Defines the task baselinewidth. */
|
|
24
|
+
baselineWidth?: number;
|
|
25
|
+
/** Defines the task baselineHeight . */
|
|
26
|
+
baselineHeight: number;
|
|
17
27
|
/** Defines the left of task.
|
|
18
28
|
*
|
|
19
29
|
* @hidden
|
|
@@ -58,6 +68,9 @@ export declare class PdfGanttTaskbarCollection {
|
|
|
58
68
|
gridLineColor: PdfColor;
|
|
59
69
|
progressFontColor: PdfColor;
|
|
60
70
|
taskColor: PdfColor;
|
|
71
|
+
baselineColor: PdfColor;
|
|
72
|
+
baselineBorderColor: PdfColor;
|
|
73
|
+
baselineTop: number;
|
|
61
74
|
labelColor: PdfColor;
|
|
62
75
|
taskBorderColor: PdfColor;
|
|
63
76
|
progressColor: PdfColor;
|
|
@@ -9,14 +9,16 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { PointF, PdfStringLayouter, PdfPen, PdfSolidBrush, RectangleF, SizeF, PdfStandardFont, PdfFontStyle, PdfStringFormat, PdfVerticalAlignment, PdfTextAlignment, PdfWordWrapType } from '@syncfusion/ej2-pdf-export';
|
|
13
|
-
import { pixelToPoint } from '../base/utils';
|
|
12
|
+
import { PointF, PdfColor, PdfStringLayouter, PdfPen, PdfSolidBrush, RectangleF, SizeF, PdfStandardFont, PdfFontStyle, PdfStringFormat, PdfVerticalAlignment, PdfTextAlignment, PdfWordWrapType } from '@syncfusion/ej2-pdf-export';
|
|
13
|
+
import { pixelToPoint, pointToPixel } from '../base/utils';
|
|
14
14
|
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
15
15
|
/**
|
|
16
16
|
* @hidden
|
|
17
17
|
*/
|
|
18
18
|
var PdfGanttTaskbarCollection = /** @class */ (function () {
|
|
19
19
|
function PdfGanttTaskbarCollection(parent) {
|
|
20
|
+
/** Defines the task baselineHeight . */
|
|
21
|
+
this.baselineHeight = 8;
|
|
20
22
|
/**
|
|
21
23
|
* @private
|
|
22
24
|
*/
|
|
@@ -63,6 +65,7 @@ var PdfGanttTaskbarCollection = /** @class */ (function () {
|
|
|
63
65
|
//code for while current pdf page is exceed
|
|
64
66
|
if (yPoint > pageSize.height) {
|
|
65
67
|
page = this.GetNextPage(page);
|
|
68
|
+
page['contentWidth'] = pointToPixel(detail.endPoint - detail.startPoint);
|
|
66
69
|
taskGraphics = page.graphics;
|
|
67
70
|
startPoint.y = 0;
|
|
68
71
|
if (this.parent.pdfExportModule.gantt.enableHeader) {
|
|
@@ -70,6 +73,11 @@ var PdfGanttTaskbarCollection = /** @class */ (function () {
|
|
|
70
73
|
startPoint.y = pixelToPoint(this.parent.timelineModule.isSingleTier ? 45 : 60);
|
|
71
74
|
}
|
|
72
75
|
isNextPage = true;
|
|
76
|
+
var graphics = page.graphics;
|
|
77
|
+
var pen = new PdfPen(new PdfColor(206, 206, 206));
|
|
78
|
+
if (page['contentWidth'] && (this.parent.gridLines == "Both" || this.parent.gridLines == "Horizontal")) {
|
|
79
|
+
graphics.drawRectangle(pen, startPoint.x, startPoint.y, page['contentWidth'] + 0.5, rowHeight);
|
|
80
|
+
}
|
|
73
81
|
}
|
|
74
82
|
this.drawLeftLabel(page, startPoint, detail, cumulativeWidth);
|
|
75
83
|
//Draw Taskbar
|
|
@@ -93,9 +101,13 @@ var PdfGanttTaskbarCollection = /** @class */ (function () {
|
|
|
93
101
|
if (!taskbar.isMilestone) {
|
|
94
102
|
var taskbarPen = new PdfPen(taskbar.taskBorderColor);
|
|
95
103
|
var taskBrush = new PdfSolidBrush(taskbar.taskColor);
|
|
104
|
+
var baselinePen = new PdfPen(taskbar.baselineBorderColor);
|
|
105
|
+
var baselineBrush = new PdfSolidBrush(taskbar.baselineColor);
|
|
96
106
|
var progressPen = new PdfPen(taskbar.progressColor);
|
|
97
107
|
var progressBrush = new PdfSolidBrush(taskbar.progressColor);
|
|
98
|
-
var
|
|
108
|
+
var adjustHeightforTaskbar = pixelToPoint((this.parent.rowHeight - this.height) / 2.0);
|
|
109
|
+
var adjustHeightforBaseline = pixelToPoint((this.parent.rowHeight - this.height) / 4.5);
|
|
110
|
+
var adjustHeight = this.parent.renderBaseline ? adjustHeightforBaseline : adjustHeightforTaskbar;
|
|
99
111
|
pageIndex = page.section.indexOf(page);
|
|
100
112
|
var startDate = isNullOrUndefined(this.unscheduleStarteDate) ? this.startDate : this.unscheduleStarteDate;
|
|
101
113
|
var endDate = isNullOrUndefined(this.unscheduleEndDate) ? this.endDate : this.unscheduleEndDate;
|
|
@@ -109,6 +121,9 @@ var PdfGanttTaskbarCollection = /** @class */ (function () {
|
|
|
109
121
|
this.drawUnscheduledTask(taskGraphics, startPoint, cumulativeWidth, adjustHeight);
|
|
110
122
|
}
|
|
111
123
|
else {
|
|
124
|
+
if (this.parent.renderBaseline && taskbar.baselineStartDate && taskbar.baselineEndDate) {
|
|
125
|
+
taskGraphics.drawRectangle(baselinePen, baselineBrush, startPoint.x + pixelToPoint(taskbar.baselineLeft - cumulativeWidth) + 0.5, startPoint.y + adjustHeight + pixelToPoint(taskbar.height + 3), pixelToPoint(this.baselineWidth), pixelToPoint(this.baselineHeight));
|
|
126
|
+
}
|
|
112
127
|
taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth) + 0.5, startPoint.y + adjustHeight, pixelToPoint(taskbar.width), pixelToPoint(taskbar.height));
|
|
113
128
|
if (this.isScheduledTask) {
|
|
114
129
|
taskGraphics.drawRectangle(progressPen, progressBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth) + 0.5, startPoint.y + adjustHeight, pixelToPoint(taskbar.progressWidth), pixelToPoint(taskbar.height));
|
|
@@ -140,6 +155,9 @@ var PdfGanttTaskbarCollection = /** @class */ (function () {
|
|
|
140
155
|
this.drawUnscheduledTask(taskGraphics, startPoint, cumulativeWidth, adjustHeight);
|
|
141
156
|
}
|
|
142
157
|
else {
|
|
158
|
+
if (this.parent.renderBaseline && taskbar.baselineStartDate && taskbar.baselineEndDate) {
|
|
159
|
+
taskGraphics.drawRectangle(baselinePen, baselineBrush, startPoint.x + pixelToPoint(taskbar.baselineLeft - cumulativeWidth) + 0.5, startPoint.y + adjustHeight + pixelToPoint(taskbar.height + 3), pixelToPoint(this.baselineWidth), pixelToPoint(this.baselineHeight));
|
|
160
|
+
}
|
|
143
161
|
taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth) + 0.5, startPoint.y + adjustHeight, pixelToPoint(renderWidth), pixelToPoint(taskbar.height));
|
|
144
162
|
taskbar.width = taskbar.width - renderWidth;
|
|
145
163
|
if (this.isScheduledTask) {
|
|
@@ -171,6 +189,9 @@ var PdfGanttTaskbarCollection = /** @class */ (function () {
|
|
|
171
189
|
this.taskStartPoint = __assign({}, startPoint);
|
|
172
190
|
this.isStartPoint = true;
|
|
173
191
|
}
|
|
192
|
+
if (this.parent.renderBaseline && taskbar.baselineStartDate && taskbar.baselineEndDate) {
|
|
193
|
+
taskGraphics.drawRectangle(baselinePen, baselineBrush, startPoint.x + pixelToPoint(taskbar.baselineLeft - cumulativeWidth) + 0.5, startPoint.y + adjustHeight + pixelToPoint(taskbar.height + 3), pixelToPoint(this.baselineWidth), pixelToPoint(this.baselineHeight));
|
|
194
|
+
}
|
|
174
195
|
taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(taskbar.left + 0.5), startPoint.y + adjustHeight, pixelToPoint(taskbar.width), pixelToPoint(taskbar.height));
|
|
175
196
|
if (this.isScheduledTask) {
|
|
176
197
|
taskGraphics.drawRectangle(progressPen, progressBrush, startPoint.x + pixelToPoint(taskbar.left + 0.5), startPoint.y + adjustHeight, pixelToPoint(taskbar.progressWidth), pixelToPoint(taskbar.height));
|
|
@@ -192,6 +213,9 @@ var PdfGanttTaskbarCollection = /** @class */ (function () {
|
|
|
192
213
|
this.taskStartPoint = __assign({}, startPoint);
|
|
193
214
|
this.isStartPoint = true;
|
|
194
215
|
}
|
|
216
|
+
if (this.parent.renderBaseline && taskbar.baselineStartDate && taskbar.baselineEndDate) {
|
|
217
|
+
taskGraphics.drawRectangle(baselinePen, baselineBrush, startPoint.x + pixelToPoint(taskbar.baselineLeft - cumulativeWidth) + 0.5, startPoint.y + adjustHeight + pixelToPoint(taskbar.height + 3), pixelToPoint(this.baselineWidth), pixelToPoint(this.baselineHeight));
|
|
218
|
+
}
|
|
195
219
|
taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(taskbar.left) + 0.5, startPoint.y + adjustHeight, pixelToPoint(detail.totalWidth), pixelToPoint(taskbar.height));
|
|
196
220
|
if (this.isScheduledTask) {
|
|
197
221
|
var progressBoundsWidth = 0;
|
|
@@ -217,6 +241,9 @@ var PdfGanttTaskbarCollection = /** @class */ (function () {
|
|
|
217
241
|
}
|
|
218
242
|
else {
|
|
219
243
|
this.drawMilestone(page, startPoint, detail, cumulativeWidth);
|
|
244
|
+
if (this.parent.renderBaseline && taskbar.baselineStartDate && taskbar.baselineEndDate) {
|
|
245
|
+
this.drawMilestone(page, startPoint, detail, cumulativeWidth);
|
|
246
|
+
}
|
|
220
247
|
}
|
|
221
248
|
this.drawRightLabel(page, startPoint, detail, cumulativeWidth);
|
|
222
249
|
return isNextPage;
|
|
@@ -375,13 +402,20 @@ var PdfGanttTaskbarCollection = /** @class */ (function () {
|
|
|
375
402
|
var pageIndex = page.section.indexOf(page);
|
|
376
403
|
this.taskStartPoint = __assign({}, startPoint);
|
|
377
404
|
var milestonePen = new PdfPen(this.milestoneColor);
|
|
378
|
-
var
|
|
405
|
+
var adjustHeightforBaselineMilesone = pixelToPoint(((this.parent.rowHeight - this.height) / 3.0));
|
|
406
|
+
var adjustHeightforMilesone = pixelToPoint(((this.parent.rowHeight - this.height) / 2.0));
|
|
407
|
+
var adjustHeight = this.parent.renderBaseline ? adjustHeightforBaselineMilesone : adjustHeightforMilesone;
|
|
379
408
|
var milestoneBrush = new PdfSolidBrush(this.milestoneColor);
|
|
409
|
+
var baselinePen = new PdfPen(this.baselineBorderColor);
|
|
410
|
+
var baselineBrush = new PdfSolidBrush(this.baselineColor);
|
|
380
411
|
taskGraphics.save(); //saving graphics state
|
|
381
|
-
var height = Math.floor(this.parent.chartRowsModule.taskBarHeight * 0.
|
|
412
|
+
var height = Math.floor(this.parent.chartRowsModule.taskBarHeight * 0.8);
|
|
382
413
|
/* eslint-disable-next-line */
|
|
383
414
|
taskGraphics.translateTransform(startPoint.x + pixelToPoint(this.left - cumulativeWidth), startPoint.y + adjustHeight - (this.parent.chartRowsModule.taskBarHeight * 0.7) / 2);
|
|
384
415
|
taskGraphics.rotateTransform(45); //apply rotation
|
|
416
|
+
if (this.parent.renderBaseline && this.baselineStartDate && this.baselineEndDate) {
|
|
417
|
+
taskGraphics.drawRectangle(baselinePen, baselineBrush, 2, 2, pixelToPoint(height), pixelToPoint(height));
|
|
418
|
+
}
|
|
385
419
|
taskGraphics.drawRectangle(milestonePen, milestoneBrush, 0, 0, pixelToPoint(height), pixelToPoint(height));
|
|
386
420
|
taskGraphics.restore(); //restoring graphics state
|
|
387
421
|
this.endPage = this.startPage = pageIndex;
|