View as Markdown

API reference: @salmonui/gantt

GanttPdfExportOptionsinterface

import type { GanttPdfExportOptions } from '@salmonui/gantt';
interface GanttPdfExportOptions<Row> {
    readonly fileName?: string;
    readonly pageSize?: 'A4' | 'A3' | 'Letter' | 'Legal' | {
        readonly width: number;
        readonly height: number;
    };
    readonly orientation?: 'portrait' | 'landscape';
    readonly fitToWidth?: boolean;
    readonly header?: string;
    readonly footer?: string;
    readonly font?: unknown;
    readonly cell?: (ctx: {
        readonly task: Row;
        readonly field: string;
        readonly value: unknown;
        text: string;
    }) => void;
    readonly headerCell?: (ctx: {
        readonly field: string;
        text: string;
    }) => void;
    readonly taskbar?: (ctx: {
        readonly task: Row;
        readonly info: GanttTaskInfo;
        color: string;
        progressColor: string;
    }) => void;
    readonly timelineCell?: (ctx: {
        readonly date: Date;
        readonly tier: 'top' | 'bottom';
        text: string;
    }) => void;
}

A PDF export.

GanttPdfExportOptions members (11)
NameSignatureDescription
fileNameoptionalreadonly fileName?: string;
pageSizeoptionalreadonly pageSize?: 'A4' | 'A3' | 'Letter' | 'Legal' | { readonly width: number; readonly height: number; };
orientationoptionalreadonly orientation?: 'portrait' | 'landscape';
fitToWidthoptionalreadonly fitToWidth?: boolean;

Scales the chart so the whole timeline fits the page width. Default false (pages across).

headeroptionalreadonly header?: string;
footeroptionalreadonly footer?: string;
fontoptionalreadonly font?: unknown;

A TrueType font for non-Latin text (the PDF writer's font).

celloptionalreadonly cell?: (ctx: { readonly task: Row; readonly field: string; readonly value: unknown; text: string; }) => void;
headerCelloptionalreadonly headerCell?: (ctx: { readonly field: string; text: string; }) => void;
taskbaroptionalreadonly taskbar?: (ctx: { readonly task: Row; readonly info: GanttTaskInfo; color: string; progressColor: string; }) => void;
timelineCelloptionalreadonly timelineCell?: (ctx: { readonly date: Date; readonly tier: 'top' | 'bottom'; text: string; }) => void;