View as Markdown

API reference: @salmonui/export/gantt

GanttPdfModelinterface

import type { GanttPdfModel } from '@salmonui/export/gantt';
interface GanttPdfModel {
    readonly title?: string;
    readonly direction?: 'ltr' | 'rtl';
    readonly columns: readonly {
        readonly header: string;
        readonly width: number;
        readonly align?: 'start' | 'center' | 'end';
    }[];
    readonly rows: readonly {
        readonly cells: readonly string[];
        readonly depth: number;
        readonly parent: boolean;
        readonly height: number;
    }[];
    readonly chartWidth: number;
    readonly headerHeight: number;
    readonly tiers: readonly {
        readonly cells: readonly {
            readonly x: number;
            readonly width: number;
            readonly text: string;
        }[];
    }[];
    readonly bars: readonly GanttPdfBar[];
    readonly connectors: readonly {
        readonly points: readonly (readonly [
            number,
            number
        ])[];
        readonly color: string;
    }[];
    readonly shades: readonly {
        readonly x: number;
        readonly width: number;
        readonly color: string;
        readonly label?: string;
    }[];
    readonly markers: readonly {
        readonly x: number;
        readonly color: string;
        readonly label?: string;
    }[];
    readonly colors: {
        readonly text: string;
        readonly headerText: string;
        readonly headerBackground: string;
        readonly line: string;
        readonly background: string;
    };
}

The laid-out Gantt chart to print, in CSS px.

GanttPdfModel members (12)
NameSignatureDescription
titleoptionalreadonly title?: string;

Document title (/Title).

directionoptionalreadonly direction?: 'ltr' | 'rtl';
columnsreadonly columns: readonly { readonly header: string; readonly width: number; readonly align?: 'start' | 'center' | 'end'; }[];

Grid pane columns, px widths.

rowsreadonly rows: readonly { readonly cells: readonly string[]; readonly depth: number; readonly parent: boolean; readonly height: number; }[];

One entry per exported row, top to bottom; cells aligned with columns (the first cell is indented by depth).

chartWidthreadonly chartWidth: number;

Chart width in px.

headerHeightreadonly headerHeight: number;

Height of the timeline header (all tiers) and of the grid header row, px.

tiersreadonly tiers: readonly { readonly cells: readonly { readonly x: number; readonly width: number; readonly text: string; }[]; }[];

Timeline header tiers, top to bottom; cells in px from the chart start.

barsreadonly bars: readonly GanttPdfBar[];
connectorsreadonly connectors: readonly { readonly points: readonly (readonly [ number, number ])[]; readonly color: string; }[];

Polylines in chart px (y from the top of the first row); the arrow is at the last point, along the last segment.

shadesreadonly shades: readonly { readonly x: number; readonly width: number; readonly color: string; readonly label?: string; }[];

Weekend / holiday shading, px.

markersreadonly markers: readonly { readonly x: number; readonly color: string; readonly label?: string; }[];

Event markers, px.

colorsreadonly colors: { readonly text: string; readonly headerText: string; readonly headerBackground: string; readonly line: string; readonly background: string; };