DayPilot.Gantt.onBeforeTaskExport

The onBeforeTaskExport event is fired during image export. It lets you customize the appearance of Gantt Chart task boxes in the exported image, e.g. provide alternative text for the event box (image export doesn't support HTML in event boxes).

Declaration

DayPilot.Gantt.onBeforeEventExport(args);

Parameters

  • args.areas (array) - active areas to be included in the exported image; includes the areas that have been already defined (in the data source and in onBeforeTaskRender)
  • args.barHeight (number)
  • args.task - exported task (DayPilot.Task), read-only
  • args.backColor (string)
  • args.borderColor (string)
  • args.fontSize (string)
  • args.fontFamily (string)
  • args.fontStyle ("normal" | "bold")
  • args.fontColor (string)
  • args.horizontalAlignment ("left" | "center" | "right")
  • args.text - exported text (string)
  • args.textLeft (string)
  • args.textPadding (number)
  • args.textRight (string)
  • args.verticalAlignment ("top" | "center" | "bottom")

Example

Basic HTML to text conversion - replaces line breaks:

dp.onBeforeEventExport = function(args) {
  args.text = args.task.data.html.replace("<br>", "\n");
};