@syncfusion/ej2-gantt 20.1.48 → 20.1.52

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.
@@ -6092,7 +6092,7 @@ class Timeline {
6092
6092
  // PDf export collection
6093
6093
  const timelineCell = {};
6094
6094
  timelineCell.startDate = new Date(startDate.getTime());
6095
- if (mode === 'Month' && tier === 'bottomTier' && ((this.parent.currentZoomingLevel.level === 5) || (this.parent.currentZoomingLevel.level === 6)) && scheduleDateCollection.length === 0) {
6095
+ if (mode === 'Month' && tier === 'bottomTier' && (count != 1) && scheduleDateCollection.length === 0) {
6096
6096
  isFirstCell = true;
6097
6097
  }
6098
6098
  parentTr = this.getHeaterTemplateString(new Date(startDate.toString()), mode, tier, false, count, timelineCell, isFirstCell);
@@ -6106,6 +6106,10 @@ class Timeline {
6106
6106
  }
6107
6107
  isFirstCell = false;
6108
6108
  startDate.setTime(newTime);
6109
+ if (startDate.getHours() === 5 && count === 2 && tier === 'bottomTier' &&
6110
+ this.parent.timelineSettings.bottomTier.unit === 'Hour') {
6111
+ startDate.setTime(startDate.getTime() - (1000 * 60 * 60));
6112
+ }
6109
6113
  if (startDate >= endDate) {
6110
6114
  /* eslint-disable-next-line */
6111
6115
  parentTr = this.getHeaterTemplateString(scheduleDateCollection[scheduleDateCollection.length - 1], mode, tier, true, count, timelineCell);
@@ -6226,12 +6230,12 @@ class Timeline {
6226
6230
  checkDate(firstDay, lastDay, increment, count) {
6227
6231
  var date = new Date(firstDay.getTime());
6228
6232
  date.setTime(date.getTime() + increment);
6229
- if (((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
6233
+ if (count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
6230
6234
  var diffCount = count - (date.getTime() - lastDay.getTime()) / (1000 * 60 * 60);
6231
6235
  if (!this.parent.isInDst(date)) {
6232
6236
  increment += (1000 * 60 * 60 * diffCount);
6233
6237
  }
6234
- else if (this.parent.isInDst(date)) {
6238
+ else if (this.parent.isInDst(date) && count !== 2) {
6235
6239
  increment -= (1000 * 60 * 60 * diffCount);
6236
6240
  }
6237
6241
  }
@@ -6984,7 +6988,7 @@ class GanttTreeGrid {
6984
6988
  return eventArgs;
6985
6989
  }
6986
6990
  treeActionComplete(args) {
6987
- const updatedArgs = extend({}, args, true);
6991
+ const updatedArgs = extend({}, args);
6988
6992
  if (getValue('requestType', args) === 'sorting') {
6989
6993
  this.parent.notify('updateModel', {});
6990
6994
  deleteObject(updatedArgs, 'isFrozen');
@@ -8039,10 +8043,10 @@ class ChartRows extends DateProcessor {
8039
8043
  'border-bottom-right-radius:' + this.getBorderRadius(data.ganttProperties) + 'px;">' +
8040
8044
  '</div>');
8041
8045
  }
8046
+ let tempDiv = createElement('div');
8042
8047
  if (this.taskLabelTemplateFunction && !isNullOrUndefined(progressDiv) && progressDiv.length > 0) {
8043
8048
  const taskLabelTemplateNode = this.taskLabelTemplateFunction(extend({ index: i }, data), this.parent, 'TaskLabelTemplate', this.getTemplateID('TaskLabelTemplate'), false, undefined, progressDiv[0]);
8044
8049
  if (taskLabelTemplateNode && taskLabelTemplateNode.length > 0) {
8045
- const tempDiv = createElement('div');
8046
8050
  tempDiv.appendChild(taskLabelTemplateNode[0]);
8047
8051
  labelString = tempDiv.innerHTML;
8048
8052
  }
@@ -8051,7 +8055,10 @@ class ChartRows extends DateProcessor {
8051
8055
  labelString = this.getTaskLabel(this.parent.labelSettings.taskLabel);
8052
8056
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
8053
8057
  }
8054
- if (labelString !== 'null') {
8058
+ if (labelString.indexOf('null') === -1) {
8059
+ if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' && !this.isTemplate(this.parent.labelSettings.taskLabel)) {
8060
+ labelString = '';
8061
+ }
8055
8062
  if (isNaN(parseInt(labelString))) {
8056
8063
  taskLabel$$1 = '<span class="' + taskLabel + '" style="line-height:' +
8057
8064
  (this.taskBarHeight - 1) + 'px; text-align: left;' +
@@ -8089,7 +8096,18 @@ class ChartRows extends DateProcessor {
8089
8096
  (isNullOrUndefined(data.ganttProperties.segments) || (!isNullOrUndefined(data.ganttProperties.segments) &&
8090
8097
  data.ganttProperties.segments.length === 0))) {
8091
8098
  if (template !== '' && !isNullOrUndefined(progressDiv) && progressDiv.length > 0) {
8092
- progressDiv[0].appendChild([].slice.call(this.createDivElement(template))[0]);
8099
+ let templateElement = this.createDivElement(template)[0];
8100
+ let childLabel = this.parent.labelSettings.taskLabel;
8101
+ if (childLabel && childLabel['elementRef'])
8102
+ templateElement.appendChild(tempDiv);
8103
+ progressDiv[0].appendChild(templateElement);
8104
+ if (progressDiv[0].querySelectorAll('.e-task-label')[0].textContent !== '' &&
8105
+ !this.isTemplate(childLabel) &&
8106
+ progressDiv[0].querySelectorAll('.e-task-label')[0].children[0])
8107
+ progressDiv[0].querySelectorAll('.e-task-label')[0].children[0].remove();
8108
+ if (progressDiv[0].querySelectorAll('.e-task-label')[0].textContent == '' &&
8109
+ childLabel && !childLabel['elementRef'] && tempDiv.innerHTML != '')
8110
+ progressDiv[0].querySelectorAll('.e-task-label')[0].textContent = childLabel;
8093
8111
  }
8094
8112
  if (!isNullOrUndefined(taskbarInnerDiv) && taskbarInnerDiv.length > 0) {
8095
8113
  taskbarInnerDiv[0].appendChild([].slice.call(progressDiv)[0]);
@@ -8663,10 +8681,10 @@ class ChartRows extends DateProcessor {
8663
8681
  'width:' + data.ganttProperties.progressWidth + 'px;' +
8664
8682
  'border-top-right-radius:' + this.getBorderRadius(data) + 'px;' +
8665
8683
  'border-bottom-right-radius:' + this.getBorderRadius(data) + 'px;height:100%;"></div>');
8684
+ let div = createElement('div');
8666
8685
  if (this.taskLabelTemplateFunction) {
8667
8686
  const parentTaskLabelNode = this.taskLabelTemplateFunction(extend({ index: i }, data), this.parent, 'TaskLabelTemplate', this.getTemplateID('TaskLabelTemplate'), false, undefined, progressBarInnerDiv[0]);
8668
8687
  if (parentTaskLabelNode && parentTaskLabelNode.length > 0) {
8669
- const div = createElement('div');
8670
8688
  div.appendChild(parentTaskLabelNode[0]);
8671
8689
  labelString = div.innerHTML;
8672
8690
  }
@@ -8675,24 +8693,38 @@ class ChartRows extends DateProcessor {
8675
8693
  labelString = this.getTaskLabel(this.parent.labelSettings.taskLabel);
8676
8694
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
8677
8695
  }
8678
- if (labelString !== 'null') {
8696
+ if (labelString.indexOf('null') === -1) {
8697
+ if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' && !this.isTemplate(this.parent.labelSettings.taskLabel)) {
8698
+ labelString = '';
8699
+ }
8679
8700
  if (isNaN(parseInt(labelString))) {
8680
- labelDiv = this.createDivElement('<span class="' + taskLabel + '" style="line-height:' +
8701
+ labelDiv = '<span class="' + taskLabel + '" style="line-height:' +
8681
8702
  (this.taskBarHeight - 1) + 'px; text-align: left;' +
8682
8703
  'display:' + 'inline-block;' +
8683
8704
  'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
8684
- this.taskBarHeight + 'px;">' + labelString + '</span>');
8705
+ this.taskBarHeight + 'px;">' + labelString + '</span>';
8685
8706
  }
8686
8707
  else {
8687
- labelDiv = this.createDivElement('<span class="' +
8708
+ labelDiv = '<span class="' +
8688
8709
  taskLabel + '" style="line-height:' +
8689
8710
  (this.taskBarHeight - 1) + 'px;' + (this.parent.viewType === 'ResourceView' ? 'display:inline-flex;' : '') +
8690
8711
  (this.parent.viewType === 'ResourceView' ? 'width:' + (data.ganttProperties.width - 10) : '') + 'px; height:' +
8691
8712
  (this.taskBarHeight - 1) + 'px;' + (this.parent.viewType === 'ResourceView' ? 'display: inline-flex;' : '') +
8692
8713
  (this.parent.viewType === 'ResourceView' ? 'width:' + (data.ganttProperties.width - 10) : '') + 'px; height:' +
8693
- this.taskBarHeight + 'px;">' + labelString + '</span>');
8714
+ this.taskBarHeight + 'px;">' + labelString + '</span>';
8694
8715
  }
8695
- progressBarInnerDiv[0].appendChild([].slice.call(labelDiv)[0]);
8716
+ let labelElement = this.createDivElement(labelDiv)[0];
8717
+ let parentLabel = this.parent.labelSettings.taskLabel;
8718
+ if (parentLabel && parentLabel['elementRef'])
8719
+ labelElement.appendChild(div);
8720
+ progressBarInnerDiv[0].appendChild(labelElement);
8721
+ if (progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent !== '' &&
8722
+ !this.isTemplate(parentLabel) &&
8723
+ progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].children[0])
8724
+ progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].children[0].remove();
8725
+ if (progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent == '' &&
8726
+ parentLabel && !parentLabel['elementRef'] && div.innerHTML != '')
8727
+ progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent = parentLabel;
8696
8728
  }
8697
8729
  const milestoneTemplate = '<div class="' + parentMilestone + '" style="position:absolute;">' +
8698
8730
  '<div class="' + parentMilestoneTop + '" style="border-right-width:' +
@@ -9519,6 +9551,18 @@ class ChartRows extends DateProcessor {
9519
9551
  }
9520
9552
  getResourceParent(record) {
9521
9553
  const chartRows = this.parent.ganttChartModule.getChartRows();
9554
+ //Below code is for rendering taskbartemplate in resource view with multi taskbar
9555
+ if (this.parent.initialChartRowElements) {
9556
+ for (let j = 0; j <= this.parent.initialChartRowElements.length; j++) {
9557
+ if (!isNullOrUndefined(chartRows[j])) {
9558
+ if (!isNullOrUndefined(chartRows[j].childNodes[0].childNodes[1].childNodes[2]) &&
9559
+ !isNullOrUndefined(this.parent.initialChartRowElements[j].childNodes[0].childNodes[1].childNodes[2])) {
9560
+ // eslint-disable-next-line
9561
+ chartRows[j].childNodes[0].childNodes[1].childNodes[2]['innerHTML'] = this.parent.initialChartRowElements[j].childNodes[0].childNodes[1].childNodes[2]['innerHTML'];
9562
+ }
9563
+ }
9564
+ }
9565
+ }
9522
9566
  this.templateData = record;
9523
9567
  const parentTrNode = this.getTableTrNode();
9524
9568
  const leftLabelNode = this.leftLabelContainer();
@@ -12526,6 +12570,9 @@ let Gantt = class Gantt extends Component {
12526
12570
  }
12527
12571
  else {
12528
12572
  this.treeGrid.dataSource = this.flatData;
12573
+ if (!isNullOrUndefined(document.getElementsByClassName('e-listview')[0])) {
12574
+ this.treeGrid.dataBind();
12575
+ }
12529
12576
  }
12530
12577
  }
12531
12578
  else {
@@ -12953,6 +13000,7 @@ let Gantt = class Gantt extends Component {
12953
13000
  this.getCurrentRecords(args);
12954
13001
  }
12955
13002
  this.notify('recordsUpdated', {});
13003
+ this.initialChartRowElements = this.ganttChartModule.getChartRows();
12956
13004
  this.isLoad = false;
12957
13005
  this.trigger('dataBound', args);
12958
13006
  }
@@ -18292,6 +18340,13 @@ class DialogEdit {
18292
18340
  dialogModel.target = document.body;
18293
18341
  dialogModel.close = this.dialogClose.bind(this);
18294
18342
  dialogModel.closeOnEscape = true;
18343
+ dialogModel.beforeClose = function (args) {
18344
+ if (args.closedBy == "escape") {
18345
+ if (args.event.name == "key-pressed" && args.event.target.nodeName == 'INPUT') {
18346
+ args.cancel = true;
18347
+ }
18348
+ }
18349
+ };
18295
18350
  dialogModel.open = (args) => {
18296
18351
  const dialogElement = getValue('element', args);
18297
18352
  const generalTabElement = dialogElement.querySelector('#' + this.parent.element.id + 'GeneralTabContainer');
@@ -18576,6 +18631,8 @@ class DialogEdit {
18576
18631
  }
18577
18632
  else if (id === ganttObj.element.id + 'NotesTabContainer') {
18578
18633
  document.getElementById(id).ej2_instances[0].refresh();
18634
+ let notesTabElement = document.querySelector('#' + this.parent.element.id + 'NotesTabContainer');
18635
+ notesTabElement.style.overflow = 'scroll';
18579
18636
  }
18580
18637
  else if (id === ganttObj.element.id + 'SegmentsTabContainer') {
18581
18638
  if (isNullOrUndefined(this.beforeOpenArgs.rowData.ganttProperties.startDate)) {
@@ -25827,6 +25884,7 @@ class Toolbar$3 {
25827
25884
 
25828
25885
  class NonWorkingDay {
25829
25886
  constructor(gantt) {
25887
+ this.weekendWidthUpdated = false;
25830
25888
  this.parent = gantt;
25831
25889
  this.nonworkingContainer = null;
25832
25890
  this.holidayContainer = null;
@@ -25966,6 +26024,14 @@ class NonWorkingDay {
25966
26024
  width = this.parent.dataOperation.getTaskWidth(start, tempEnd);
25967
26025
  isFirstCell = false;
25968
26026
  }
26027
+ let sDate = new Date(startDate);
26028
+ sDate.setDate(sDate.getDate() + 1);
26029
+ if (sDate.getTimezoneOffset() != this.parent.timelineModule.timelineStartDate.getTimezoneOffset() && !this.weekendWidthUpdated) {
26030
+ if (this.parent.timelineModule.bottomTier == 'Hour' && this.parent.timelineSettings.bottomTier.count === 1) {
26031
+ width = width - this.parent.timelineSettings.timelineUnitSize;
26032
+ this.weekendWidthUpdated = true;
26033
+ }
26034
+ }
25969
26035
  const weekendDiv = createElement('div', {
25970
26036
  className: weekend, styles: `left:${left}px;width:${width}px;height:100%;`
25971
26037
  });
@@ -30112,6 +30178,9 @@ class ExportHelper {
30112
30178
  if (data[this.parent.labelSettings.rightLabel]) {
30113
30179
  taskbar.rightTaskLabel.value = data[this.parent.labelSettings.rightLabel].toString();
30114
30180
  }
30181
+ if (data[this.parent.labelSettings.taskLabel]) {
30182
+ taskbar.taskLabel = data[this.parent.labelSettings.taskLabel].toString();
30183
+ }
30115
30184
  const reduceLeft = ganttProp.isMilestone ? Math.floor(this.parent.chartRowsModule.taskBarHeight / 2) + 33 : 33; // 33 indicates default timeline cell width
30116
30185
  taskbar.rightTaskLabel.left = ganttProp.left + ganttProp.width + reduceLeft; // right label left value
30117
30186
  taskbar.fontFamily = this.ganttStyle.fontFamily;
@@ -30460,6 +30529,12 @@ class PdfGanttTaskbarCollection {
30460
30529
  const progressFormat = new PdfStringFormat();
30461
30530
  progressFormat.lineAlignment = PdfVerticalAlignment.Middle;
30462
30531
  progressFormat.alignment = PdfTextAlignment.Right;
30532
+ let isLabelString = false;
30533
+ let updatedWidth;
30534
+ if (/^[a-zA-Z]/.test(this.taskLabel)) {
30535
+ isLabelString = true;
30536
+ progressFormat.alignment = PdfTextAlignment.Left;
30537
+ }
30463
30538
  let pageIndex = -1;
30464
30539
  if (!taskbar.isMilestone) {
30465
30540
  const taskbarPen = new PdfPen(taskbar.taskBorderColor);
@@ -30481,10 +30556,14 @@ class PdfGanttTaskbarCollection {
30481
30556
  }
30482
30557
  else {
30483
30558
  taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth) + 0.5, startPoint.y + adjustHeight, pixelToPoint(taskbar.width), pixelToPoint(taskbar.height));
30484
- if (this.progress > 0 && this.progressWidth > 0 && this.isScheduledTask) {
30559
+ if (this.isScheduledTask) {
30485
30560
  taskGraphics.drawRectangle(progressPen, progressBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth) + 0.5, startPoint.y + adjustHeight, pixelToPoint(taskbar.progressWidth), pixelToPoint(taskbar.height));
30486
- if (!isNullOrUndefined(this.parent.taskFields.progress) && !isNullOrUndefined(this.parent.labelSettings.taskLabel)) {
30487
- taskGraphics.drawString(this.progress.toString(), font, fontColor, fontBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth), startPoint.y + adjustHeight, pixelToPoint(this.progressWidth), pixelToPoint(this.height), progressFormat);
30561
+ if (!isNullOrUndefined(this.parent.labelSettings.taskLabel) && !isNullOrUndefined(this.taskLabel)) {
30562
+ updatedWidth = this.progressWidth;
30563
+ if (isLabelString) {
30564
+ updatedWidth = this.width;
30565
+ }
30566
+ taskGraphics.drawString(this.taskLabel.toString(), font, fontColor, fontBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth), startPoint.y + adjustHeight, pixelToPoint(updatedWidth), pixelToPoint(this.height), progressFormat);
30488
30567
  }
30489
30568
  }
30490
30569
  }
@@ -30499,14 +30578,16 @@ class PdfGanttTaskbarCollection {
30499
30578
  this.isStartPoint = true;
30500
30579
  }
30501
30580
  let renderWidth = 0;
30502
- this.width = this.width - (detail.totalWidth - (this.left - cumulativeWidth));
30581
+ if (!isLabelString) {
30582
+ this.width = this.width - (detail.totalWidth - (this.left - cumulativeWidth));
30583
+ }
30503
30584
  renderWidth = (detail.totalWidth - (this.left - cumulativeWidth));
30504
30585
  if (!this.isScheduledTask && this.unscheduledTaskBy !== 'duration') {
30505
30586
  this.drawUnscheduledTask(taskGraphics, startPoint, cumulativeWidth, adjustHeight);
30506
30587
  }
30507
30588
  else {
30508
30589
  taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth) + 0.5, startPoint.y + adjustHeight, pixelToPoint(renderWidth), pixelToPoint(taskbar.height));
30509
- if (this.progress > 0 && this.progressWidth > 0 && this.isScheduledTask) {
30590
+ if (this.isScheduledTask) {
30510
30591
  let progressBoundsWidth = 0;
30511
30592
  if (this.progressWidth <= renderWidth) {
30512
30593
  progressBoundsWidth = this.progressWidth;
@@ -30516,8 +30597,12 @@ class PdfGanttTaskbarCollection {
30516
30597
  }
30517
30598
  taskGraphics.drawRectangle(progressPen, progressBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth) + 0.5, startPoint.y + adjustHeight, pixelToPoint(progressBoundsWidth), pixelToPoint(taskbar.height));
30518
30599
  this.progressWidth -= progressBoundsWidth;
30519
- if (this.progressWidth === 0 && this.progress !== 0 && this.parent.labelSettings.taskLabel) {
30520
- taskGraphics.drawString(this.progress.toString(), font, fontColor, fontBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth), (startPoint.y + adjustHeight), pixelToPoint(progressBoundsWidth), pixelToPoint(this.height), progressFormat);
30600
+ if (this.parent.labelSettings.taskLabel && !isNullOrUndefined(this.taskLabel)) {
30601
+ updatedWidth = progressBoundsWidth;
30602
+ if (isLabelString) {
30603
+ updatedWidth = this.width;
30604
+ }
30605
+ taskGraphics.drawString(this.taskLabel.toString(), font, fontColor, fontBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth), (startPoint.y + adjustHeight), pixelToPoint(updatedWidth), pixelToPoint(this.height), progressFormat);
30521
30606
  }
30522
30607
  }
30523
30608
  }
@@ -30534,8 +30619,12 @@ class PdfGanttTaskbarCollection {
30534
30619
  taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(taskbar.left + 0.5), startPoint.y + adjustHeight, pixelToPoint(taskbar.width), pixelToPoint(taskbar.height));
30535
30620
  if (this.isScheduledTask) {
30536
30621
  taskGraphics.drawRectangle(progressPen, progressBrush, startPoint.x + pixelToPoint(taskbar.left + 0.5), startPoint.y + adjustHeight, pixelToPoint(taskbar.progressWidth), pixelToPoint(taskbar.height));
30537
- if (this.progressWidth === 0 && this.progress !== 0) {
30538
- taskGraphics.drawString(this.progress.toString(), font, fontColor, fontBrush, startPoint.x + pixelToPoint(this.left), (startPoint.y + adjustHeight), pixelToPoint(this.progressWidth), pixelToPoint(this.height), progressFormat);
30622
+ if (!isNullOrUndefined(this.taskLabel)) {
30623
+ updatedWidth = this.progressWidth;
30624
+ if (isLabelString) {
30625
+ updatedWidth = this.width;
30626
+ }
30627
+ taskGraphics.drawString(this.taskLabel.toString(), font, fontColor, fontBrush, startPoint.x + pixelToPoint(this.left), (startPoint.y + adjustHeight), pixelToPoint(updatedWidth), pixelToPoint(this.height), progressFormat);
30539
30628
  }
30540
30629
  }
30541
30630
  this.isCompleted = true;
@@ -30549,7 +30638,7 @@ class PdfGanttTaskbarCollection {
30549
30638
  this.isStartPoint = true;
30550
30639
  }
30551
30640
  taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(taskbar.left) + 0.5, startPoint.y + adjustHeight, pixelToPoint(detail.totalWidth), pixelToPoint(taskbar.height));
30552
- if (this.progress > 0 && this.progressWidth > 0 && this.isScheduledTask) {
30641
+ if (this.isScheduledTask) {
30553
30642
  let progressBoundsWidth = 0;
30554
30643
  if (this.progressWidth <= detail.totalWidth) {
30555
30644
  progressBoundsWidth = this.progressWidth;
@@ -30559,8 +30648,12 @@ class PdfGanttTaskbarCollection {
30559
30648
  }
30560
30649
  taskGraphics.drawRectangle(progressPen, progressBrush, startPoint.x + pixelToPoint(taskbar.left) + 0.5, startPoint.y + adjustHeight, pixelToPoint(progressBoundsWidth), pixelToPoint(taskbar.height));
30561
30650
  this.progressWidth -= progressBoundsWidth;
30562
- if (this.progressWidth === 0 && this.progress !== 0) {
30563
- taskGraphics.drawString(this.progress.toString(), font, fontColor, fontBrush, startPoint.x + pixelToPoint(this.left), (startPoint.y + adjustHeight), pixelToPoint(progressBoundsWidth), pixelToPoint(this.height), progressFormat);
30651
+ if (!isNullOrUndefined(this.taskLabel)) {
30652
+ updatedWidth = progressBoundsWidth;
30653
+ if (isLabelString) {
30654
+ updatedWidth = this.width;
30655
+ }
30656
+ taskGraphics.drawString(this.taskLabel.toString(), font, fontColor, fontBrush, startPoint.x + pixelToPoint(this.left), (startPoint.y + adjustHeight), pixelToPoint(updatedWidth), pixelToPoint(this.height), progressFormat);
30564
30657
  }
30565
30658
  }
30566
30659
  this.isCompleted = false;