DayPilot.Gantt.onBeforeCornerExport

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.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.

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
  @beforeCornerExport="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:

LitePro
DayPilot for JavaScript