Chart Configuration
The Chart Configuration module provides comprehensive control over your Gantt chart's behavior and appearance. This guide explains the essential configuration options and how to use them effectively.
Basic Configuration
The GGanttChart component accepts several key configuration properties that define its core functionality:
typescript
<g-gantt-chart
:chart-start="'2024-01-01'"
:chart-end="'2024-12-31'"
:precision="'day'"
:bar-start="'start'"
:bar-end="'end'"
:row-height="40"
:width="'100%'"
:color-scheme="'default'"
:grid="true"
:push-on-overlap="true"
:no-overlap="false"
:commands="true"
/>
Essential Properties
chart-start
andchart-end
: Define the visible time range (string | Date)precision
: Sets the time unit ('hour', 'day', 'week', 'month')bar-start
andbar-end
: Specify data properties for datesrow-height
: Controls row height in pixelswidth
: Chart width (percentage or pixels)
Advanced Configuration
typescript
interface GGanttChartConfig {
enableMinutes?: boolean;
enableConnections?: boolean;
defaultConnectionType?: ConnectionType;
maxRows?: number;
labelColumnTitle?: string;
labelColumnWidth?: string;
font?: string;
dateFormat?: string;
}
Event Handling
The chart emits various events that you can listen to:
typescript
<g-gantt-chart
@click-bar="handleClick"
@drag-bar="handleDrag"
@dragend-bar="handleDragEnd"
@mouseenter-bar="handleMouseEnter"
@mouseleave-bar="handleMouseLeave"
@sort="handleSort"
/>
Performance Optimization
For optimal performance:
- Use appropriate precision for your needs
- Limit the visible time range
- Consider pagination for large datasets
- Use maxRows for controlled loading