The Gantt Chart supports client-side image export to the following formats:

  • SVG
  • PNG
  • JPEG

The client-side export is supported since version 2018.4.3505.

Event Corner Radii

Image export preserves uniform pixel corner radii on normal task boxes. Group and milestone shapes retain their own representations.

Active Areas and Appearance

PNG, JPEG and SVG export include supported active areas from normal tasks, groups, milestones, grid cells, time headers, row-header cells and the upper-left corner. Areas can supply text, colors, borders, images and SVG symbols. Positioning and clipping follow the containing item and the exported viewport.

Use onBeforeTaskExport and the corresponding cell/header export callbacks to replace args.areas or clear it with []. The descriptors are copied for export. Areas created only by onAfterRender DOM code are not rendered; supply their supported descriptor fields instead.

Image export supports numeric, uniform active-area corner radii and selected border sides. CSS percentage radii, different radii on individual corners and arbitrary custom HTML are not supported.

Dependency-link export preserves supported link shape, color, line style, arrow direction and event layering within a grid. Links spanning frozen grids or projected onto sticky parent rows are excluded. Styling applied only through onBeforeLinkRender is not exported; store exportable styles in the link data.

PNG and JPEG exports can fail when a browser cannot allocate, draw or encode a bitmap. Handle BITMAP_EXPORT_FAILED and inspect its stage; see the exportAs() error contract. Use a smaller area or scale when needed. SVG avoids bitmap allocation; asset and font loading remain application responsibilities.

These excerpts configure an existing DayPilot Pro component. Keep its current timeline, resources and events.

JavaScript

const dp = new DayPilot.Gantt("dp", {
  onBeforeTaskExport: (args) => { args.areas = []; }
});
dp.init();

Angular

<daypilot-gantt [config]="config"></daypilot-gantt>
config: DayPilot.GanttConfig = {
  onBeforeTaskExport: (args) => { args.areas = []; }
};

React

<DayPilotGantt
  onBeforeTaskExport={(args) => { args.areas = []; }}
/>

Vue

<DayPilotGantt
  :onBeforeTaskExport='(args) => { args.areas = []; }'
/>

The example suppresses active areas on exported tasks while retaining them in the interactive view. Use the Gantt control’s exportAs() method to download the image; see the linked API reference for framework control access.

Download an Image

dp.exportAs("svg", {area: "viewport"}).download();

Demos

Availability

Availability of this feature in DayPilot editions:

ProductLitePro
DayPilot for JavaScript
DayPilot for ASP.NET WebForms
DayPilot for ASP.NET MVC
DayPilot for Java