The onBeforeCornerExport event handler fires during image and Excel export. It lets you customize the appearance of the upper-left corner of the Gantt Chart component.

Available since version 2023.1.5529.

Declaration

DayPilot.Gantt.onBeforeCornerExport(args)

Parameters

  • args.areas (DayPilot.AreaData[]): active areas for image export

  • args.backColor (string) - background color.

  • args.fontSize (string) - font size.

  • args.fontFamily (string) - font family.

  • args.fontStyle ("normal" | "bold") - font style.

  • args.fontColor (string) - font color.

  • args.horizontalAlignment ("left" | "center" | "right") - horizontal text alignment.

  • args.text (string) - exported text.

  • args.verticalAlignment ("top" | "center" | "bottom") - vertical text alignment.

Notes

Use this event to replace the exported corner label or adjust its font, colors, and alignment without changing the live corner content.

Active Areas in Image Export

For PNG, JPEG and SVG export, args.areas contains copies of the active-area descriptors prepared for this item. Replace it or assign [] to change only the exported areas. The export does not call an area’s onAfterRender DOM callback. Custom HTML remains outside the supported image-export representation.

Corner areas come from the prepared live corner. Export does not rerun onBeforeCornerRender; use this export callback to replace or clear the copied areas.

Examples

JavaScript

const gantt = new DayPilot.Gantt("dp", {
  onBeforeCornerExport: (args) => {
    args.text = DayPilot.Date.today().toString("yyyy");
  },
  // ...
});
gantt.init();

Angular

<daypilot-gantt [config]="config"></daypilot-gantt>
config: DayPilot.GanttConfig = {
  onBeforeCornerExport: args => {
    args.text = DayPilot.Date.today().toString("yyyy");
  },
  // ...
};

React

<DayPilotGantt
  onBeforeCornerExport={onBeforeCornerExport}
/>
const onBeforeCornerExport = (args) => {
  args.text = DayPilot.Date.today().toString("yyyy");
};

Vue

<DayPilotGantt
  :onBeforeCornerExport="onBeforeCornerExport"
/>
const onBeforeCornerExport = (args) => {
  args.text = DayPilot.Date.today().toString("yyyy");
};

See Also

Client-Side Image Export [doc.daypilot.org]

DayPilot.Gantt Class

Availability

Availability of this API item in DayPilot editions:

ProductLitePro
DayPilot for JavaScript