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.
DayPilot.Gantt.onBeforeCornerExport(args)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.
Use this event to replace the exported corner label or adjust its font, colors, and alignment without changing the live corner content.
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");
};Client-Side Image Export [doc.daypilot.org]