It is not only a fully functional graph visualization library, but also an explorer of data relationships.
!!!###!!!title=Gantt Markline——VisActor/VTable tutorial documents!!!###!!!!!!###!!!description=VTable-Gantt component supports adding mark lines on the Gantt chart, which can be used to represent important time nodes of the entire project.!!!###!!!
Gantt Mark Line
VTable-Gantt component supports adding mark lines on the Gantt chart, which can be used to represent important time nodes of the entire project.
boolean: Whether to display the mark line, the default is false. When the mark line configuration is false, the mark line is not displayed.
IMarkLine: Single mark line configuration
Array: Multiple mark line configurations
The configuration items of IMarkLine are as follows:
export interface IMarkLine {
date: string;
style?: IMarkLineStyle | ((args: IMarkLineStyleArgumentType) => IMarkLineStyle);
/** The position of the mark line under the date column. The default is 'left'. */
position?: 'left' | 'right' | 'middle' | 'date';
/** Automatically scroll the date range to include this mark line. */
scrollToMarkLine?: boolean;
content?: string; // markLine content
/** The style of the content in the markLine. */
contentStyle?: {
color?: string;
fontSize?: string;
fontWeight?: string;
lineHeight?: string;
backgroundColor?: string;
cornerRadius?: string;
}
}
export type IMarkLineStyle = Omit<ILineStyle, 'lineWidth'> & {
lineWidth?: number | ((args: IMarkLineStyleArgumentType) => number);
};
export type IMarkLineStyleArgumentType = {
date: Date;
dateIndex: number;
dateX: number;
cellStartX: number;
cellWidth: number;
timelineColWidth: number;
millisecondsPerPixel: number;
};
Mark Line Style
The configuration example of the mark line style is as follows:
When the mark line width needs to change with timeline zooming, configure style.lineWidth as a function. The function is re-executed whenever the mark line refreshes, and its argument includes the current timeline column width, cell width, and milliseconds-per-pixel ratio:
Normally, if the date '2024-01-01' is outside the display range of the Gantt chart, when the scrollToMarkLine: true configuration is set, the Gantt chart will automatically scroll to the mark line position.