# GC.Spread.Sheets.GanttSheet

## Content

# Namespace: GanttSheet

[Spread](GC.Spread).[Sheets](GC.Spread.Sheets).GanttSheet

## Table of contents

### Enumerations

- [DayOfWeek](../enums/GC.Spread.Sheets.GanttSheet.DayOfWeek)
- [GanttGridlineType](../enums/GC.Spread.Sheets.GanttSheet.GanttGridlineType)
- [TimescaleTierMode](../enums/GC.Spread.Sheets.GanttSheet.TimescaleTierMode)
- [TimescaleUnit](../enums/GC.Spread.Sheets.GanttSheet.TimescaleUnit)

### Classes

- [Calendar](../classes/GC.Spread.Sheets.GanttSheet.Calendar)
- [CalendarSettings](../classes/GC.Spread.Sheets.GanttSheet.CalendarSettings)
- [Collection](../classes/GC.Spread.Sheets.GanttSheet.Collection)
- [CustomWorkWeek](../classes/GC.Spread.Sheets.GanttSheet.CustomWorkWeek)
- [GanttGridlines](../classes/GC.Spread.Sheets.GanttSheet.GanttGridlines)
- [GanttMapping](../classes/GC.Spread.Sheets.GanttSheet.GanttMapping)
- [GanttSheet](../classes/GC.Spread.Sheets.GanttSheet.GanttSheet)
- [NonWorkingTimeStyle](../classes/GC.Spread.Sheets.GanttSheet.NonWorkingTimeStyle)
- [Project](../classes/GC.Spread.Sheets.GanttSheet.Project)
- [Task](../classes/GC.Spread.Sheets.GanttSheet.Task)
- [TaskDependency](../classes/GC.Spread.Sheets.GanttSheet.TaskDependency)
- [TaskbarLayout](../classes/GC.Spread.Sheets.GanttSheet.TaskbarLayout)
- [TaskbarStyleRule](../classes/GC.Spread.Sheets.GanttSheet.TaskbarStyleRule)
- [Timescale](../classes/GC.Spread.Sheets.GanttSheet.Timescale)
- [TimescaleTier](../classes/GC.Spread.Sheets.GanttSheet.TimescaleTier)
- [WorkWeek](../classes/GC.Spread.Sheets.GanttSheet.WorkWeek)

### Type aliases

- [Duration](GC.Spread.Sheets.GanttSheet#duration)
- [DurationUnit](GC.Spread.Sheets.GanttSheet#durationunit)
- [GanttGridline](GC.Spread.Sheets.GanttSheet#ganttgridline)
- [GanttGridlineInterval](GC.Spread.Sheets.GanttSheet#ganttgridlineinterval)
- [GridStyle](GC.Spread.Sheets.GanttSheet#gridstyle)
- [IGanttSheetOptions](GC.Spread.Sheets.GanttSheet#iganttsheetoptions)
- [ITaskData](GC.Spread.Sheets.GanttSheet#itaskdata)
- [ITaskDependency](GC.Spread.Sheets.GanttSheet#itaskdependency)
- [NonWorkingTimeDrawMode](GC.Spread.Sheets.GanttSheet#nonworkingtimedrawmode)
- [TaskDependencyType](GC.Spread.Sheets.GanttSheet#taskdependencytype)
- [TaskScheduleMode](GC.Spread.Sheets.GanttSheet#taskschedulemode)
- [TaskStyle](GC.Spread.Sheets.GanttSheet#taskstyle)
- [TaskbarEndShape](GC.Spread.Sheets.GanttSheet#taskbarendshape)
- [TaskbarEndType](GC.Spread.Sheets.GanttSheet#taskbarendtype)
- [TaskbarFillPattern](GC.Spread.Sheets.GanttSheet#taskbarfillpattern)
- [TaskbarLinkMode](GC.Spread.Sheets.GanttSheet#taskbarlinkmode)
- [TaskbarMiddleShape](GC.Spread.Sheets.GanttSheet#taskbarmiddleshape)
- [TaskbarStyle](GC.Spread.Sheets.GanttSheet#taskbarstyle)
- [TaskbarStyleRuleName](GC.Spread.Sheets.GanttSheet#taskbarstylerulename)
- [TextStyle](GC.Spread.Sheets.GanttSheet#textstyle)
- [Time](GC.Spread.Sheets.GanttSheet#time)
- [TimescaleLabelFormatter](GC.Spread.Sheets.GanttSheet#timescalelabelformatter)
- [WorkDay](GC.Spread.Sheets.GanttSheet#workday)
- [WorkTime](GC.Spread.Sheets.GanttSheet#worktime)

## Type aliases

### <a id="duration" name="duration"></a> Duration

Ƭ **Duration**: `Object`

Represents a duration in scheduling. To create a valid duration, please call project.parseDuration method.

**`property`** {number} [value] Indicates the value in unit of the duration.

**`property`** {GC.Spread.Sheets.GanttSheet.DurationUnit} [unit] Indicates the unit of the value. If not specified, the default unit in [GC.Spread.Sheets.GanttSheet.CalendarSettings](../classes/GC.Spread.Sheets.GanttSheet.CalendarSettings) will be used.

**`property`** {number} [time] Indicates the real duration time in milliseconds.

#### Type declaration

| Name | Type |
| :------ | :------ |
| `time?` | `number` |
| `unit?` | [`DurationUnit`](GC.Spread.Sheets.GanttSheet#durationunit) |
| `value?` | `number` |

___

### <a id="durationunit" name="durationunit"></a> DurationUnit

Ƭ **DurationUnit**: ``"Month"`` \| ``"Week"`` \| ``"Day"`` \| ``"Hour"`` \| ``"Minute"``

**`description`** Represents the unit of a duration.

___

### <a id="ganttgridline" name="ganttgridline"></a> GanttGridline

Ƭ **GanttGridline**: `Object`

Represents how to draw a gridline on GanttChart.

**`property`** {GC.Spread.Sheets.GanttSheet.GanttGridlineType} lineType The type of the line.

**`property`** {GC.Data.ColorString} lineColor The color of the line.

#### Type declaration

| Name | Type |
| :------ | :------ |
| `lineColor` | [`ColorString`](GC.Data#colorstring) |
| `lineType` | [`GanttGridlineType`](../enums/GC.Spread.Sheets.GanttSheet.GanttGridlineType) |

___

### <a id="ganttgridlineinterval" name="ganttgridlineinterval"></a> GanttGridlineInterval

Ƭ **GanttGridlineInterval**: `Object`

Represents how to draw a gridline with intervals on GanttChart.

**`property`** {GC.Spread.Sheets.GanttSheet.GanttGridlineType} lineType The type of the normal line.

**`property`** {GC.Data.ColorString} lineColor The color of the normal line.

**`property`** {number} [interval] The interval count. Lines at multiples of the interval value will use the intervalType and intervalColor.

**`property`** {GC.Spread.Sheets.GanttSheet.GanttGridlineType} [intervalLineType] The type of the interval lines.

**`property`** {GC.Data.ColorString} [intervalLineColor] The color of the interval lines.

#### Type declaration

| Name | Type |
| :------ | :------ |
| `interval?` | `number` |
| `intervalLineColor?` | [`ColorString`](GC.Data#colorstring) |
| `intervalLineType?` | [`GanttGridlineType`](../enums/GC.Spread.Sheets.GanttSheet.GanttGridlineType) |
| `lineColor` | [`ColorString`](GC.Data#colorstring) |
| `lineType` | [`GanttGridlineType`](../enums/GC.Spread.Sheets.GanttSheet.GanttGridlineType) |

___

### <a id="gridstyle" name="gridstyle"></a> GridStyle

Ƭ **GridStyle**: `Object`

Represents the style of a task grid.

**`property`** {string} [font] Indicates the font of text.

**`property`** {GC.Data.ColorString} [color] Indicates the color of text.

**`property`** {GC.Data.ColorString} [backColor] Indicates the back color of text.

**`property`** {GC.Spread.Sheets.TextDecorationType} [textDecoration] Indicates the decoration of text.

#### Type declaration

| Name | Type |
| :------ | :------ |
| `backColor?` | `string` |
| `color?` | `string` |
| `font?` | `string` |
| `textDecoration?` | [`TextDecorationType`](../enums/GC.Spread.Sheets.TextDecorationType) |

___

### <a id="iganttsheetoptions" name="iganttsheetoptions"></a> IGanttSheetOptions

Ƭ **IGanttSheetOptions**: `Object`

Represents the gantt sheet options

**`property`** {boolean} [enableGanttColumn] Whether to show the gantt column. Default is true.

**`property`** {boolean} [allowAddNew] - Whether to allow to add new empty row.

**`property`** {boolean} [sheetTabColor] - A color string used to represent the sheet tab color, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on.

#### Type declaration

| Name | Type | Description |
| :------ | :------ | :------ |
| `allowAddNew?` | `boolean` | Whether to allow to add new empty row. |
| `enableGanttColumn?` | `boolean` | Whether to show the gantt column. Default is true. |
| `sheetTabColor?` | `string` | A color string used to represent the sheet tab color, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. |

___

### <a id="itaskdata" name="itaskdata"></a> ITaskData

Ƭ **ITaskData**: `Object`

Represents the data to create tasks. It is used in add, insert, and renew tasks methods of project.

**`property`** {string} [name] Indicates the name of the task.

**`property`** {Date} [start] Indicates the start date of the task.

**`property`** {Date} [finish] Indicates the finish date of the task.

**`property`** {GC.Spread.Sheets.GanttSheet.Duration} [duration] Indicates the duration of the task.

**`property`** {GC.Spread.Sheets.GanttSheet.TaskScheduleMode} [mode] Indicates the scheduling mode of the task.

**`property`** {Object.<string, GC.Spread.Sheets.GanttSheet.TaskbarStyle>} [barStyles] Indicates the bar styles of the task.

#### Type declaration

| Name | Type |
| :------ | :------ |
| `barStyles?` | { `[key: string]`: [`TaskbarStyle`](GC.Spread.Sheets.GanttSheet#taskbarstyle);  } |
| `duration?` | [`Duration`](GC.Spread.Sheets.GanttSheet#duration) |
| `finish?` | `Date` |
| `mode?` | [`TaskScheduleMode`](GC.Spread.Sheets.GanttSheet#taskschedulemode) |
| `name?` | `string` |
| `start?` | `Date` |

___

### <a id="itaskdependency" name="itaskdependency"></a> ITaskDependency

Ƭ **ITaskDependency**: `Object`

Represents a couple of parameters for adding task dependencies.

**`property`** {number} fromTaskNumber Indicates the number of the task which the dependency is from.

**`property`** {number} toTaskNumber Indicates the number of the task which the dependency is to.

**`property`** {GC.Spread.Sheets.GanttSheet.TaskDependencyType} [type] Optional. Indicates the dependency type. The default is 'FS' (Finish to Start).

#### Type declaration

| Name | Type |
| :------ | :------ |
| `fromTaskNumber` | `number` |
| `toTaskNumber` | `number` |
| `type?` | [`TaskDependencyType`](GC.Spread.Sheets.GanttSheet#taskdependencytype) |

___

### <a id="nonworkingtimedrawmode" name="nonworkingtimedrawmode"></a> NonWorkingTimeDrawMode

Ƭ **NonWorkingTimeDrawMode**: ``"Behind"`` \| ``"None"``

**`description`** Represents how to draw the non-working time area in GanttChart.

___

### <a id="taskdependencytype" name="taskdependencytype"></a> TaskDependencyType

Ƭ **TaskDependencyType**: ``"FS"`` \| ``"SS"`` \| ``"FF"`` \| ``"SF"``

**`description`** Represents the type for task dependency.

___

### <a id="taskschedulemode" name="taskschedulemode"></a> TaskScheduleMode

Ƭ **TaskScheduleMode**: ``"Auto"`` \| ``"Manual"``

**`description`** Represents the scheduling mode for tasks.

___

### <a id="taskstyle" name="taskstyle"></a> TaskStyle

Ƭ **TaskStyle**: `Object`

the task style

**`property`** {string} [name] The task style name.

**`property`** {GC.Spread.Sheets.GanttSheet.TaskbarStyle} [taskbarStyle] The task bar part style.

**`property`** {GC.Spread.Sheets.GanttSheet.GridStyle} [gridStyle] The task grid part style.

#### Type declaration

| Name | Type |
| :------ | :------ |
| `gridStyle?` | [`GridStyle`](GC.Spread.Sheets.GanttSheet#gridstyle) |
| `name?` | `string` |
| `taskbarStyle?` | [`TaskbarStyle`](GC.Spread.Sheets.GanttSheet#taskbarstyle) |

___

### <a id="taskbarendshape" name="taskbarendshape"></a> TaskbarEndShape

Ƭ **TaskbarEndShape**: ``"arrowDown"`` \| ``"arrowUp"`` \| ``"caretDownTop"`` \| ``"caretUpBottom"`` \| ``"circle"`` \| ``"circleArrowDown"`` \| ``"circleArrowUp"`` \| ``"circleDiamond"`` \| ``"circleTriangleDown"`` \| ``"circleTriangleUp"`` \| ``"diamond"`` \| ``"houseDown"`` \| ``"houseUp"`` \| ``"leftBracket"`` \| ``"leftFade"`` \| ``"lineShape"`` \| ``"rightBracket"`` \| ``"rightFade"`` \| ``"square"`` \| ``"star"`` \| ``"triangleDown"`` \| ``"triangleLeft"`` \| ``"triangleRight"`` \| ``"triangleUp"``

**`description`** Represents the shapes for taskbar start part and end part.

___

### <a id="taskbarendtype" name="taskbarendtype"></a> TaskbarEndType

Ƭ **TaskbarEndType**: ``"solid"`` \| ``"dashed"`` \| ``"framed"``

**`description`** Represents the drawing type for taskbar end shapes.

___

### <a id="taskbarfillpattern" name="taskbarfillpattern"></a> TaskbarFillPattern

Ƭ **TaskbarFillPattern**: ``"hollow"`` \| ``"solidFill"`` \| ``"lightFill"`` \| ``"mediumFill"`` \| ``"darkFill"`` \| ``"diagonalRight"`` \| ``"diagonalLeft"`` \| ``"diagonalCross"`` \| ``"lineVertical"`` \| ``"lineHorizontal"`` \| ``"lineCross"`` \| ``"dashedBorder"``

**`description`** Represents the fill pattern for taskbar middle part or non working time area in GanttChart.

___

### <a id="taskbarlinkmode" name="taskbarlinkmode"></a> TaskbarLinkMode

Ƭ **TaskbarLinkMode**: ``"noLinks"`` \| ``"toEnd"`` \| ``"toTop"``

**`description`** Represents how to draw the link lines between task bars.

___

### <a id="taskbarmiddleshape" name="taskbarmiddleshape"></a> TaskbarMiddleShape

Ƭ **TaskbarMiddleShape**: ``"rectangleBar"`` \| ``"lineTop"`` \| ``"lineMiddle"`` \| ``"lineBottom"`` \| ``"rectangleTop"`` \| ``"rectangleMiddle"`` \| ``"rectangleBottom"``

**`description`** Represents the shapes for task bar middle part.

___

### <a id="taskbarstyle" name="taskbarstyle"></a> TaskbarStyle

Ƭ **TaskbarStyle**: `Object`

Represents the style of a task bar.

**`property`** {GC.Spread.Sheets.GanttSheet.TaskbarEndShape} [startShape] Indicates the shape of the start part.

**`property`** {GC.Spread.Sheets.GanttSheet.TaskbarEndType} [startType] Indicates the type of the start part.

**`property`** {GC.Data.ColorString} [startColor] Indicates the color of the start part.

**`property`** {GC.Spread.Sheets.GanttSheet.TaskbarEndShape} [endShape] Indicates the shape of the end part.

**`property`** {GC.Spread.Sheets.GanttSheet.TaskbarEndType} [endType] Indicates the type of the end part.

**`property`** {GC.Data.ColorString} [endColor] Indicates the color of the end part.

**`property`** {GC.Spread.Sheets.GanttSheet.TaskbarMiddleShape} [middleShape] Indicates the shape of the middle part.

**`property`** {GC.Spread.Sheets.GanttSheet.TaskbarFillPattern} [middlePattern] Indicates the fill pattern of the middle part.

**`property`** {GC.Data.ColorString} [middleColor] Indicates the color of the middle part.

**`property`** {string} [leftText] Indicates the name of a task field or formula, which value will be displayed as text at left side of the bar.

**`property`** {GC.Spread.Sheets.GanttSheet.TextStyle} [leftTextStyle] Indicates the the style of the taskbar's left task field.

**`property`** {string} [rightText] Indicates the name of a task field or formula, which value will be displayed as text at right side of the bar.

**`property`** {GC.Spread.Sheets.GanttSheet.TextStyle} [rightTextStyle] Indicates the the style of the taskbar's left task field.

**`property`** {string} [topText] Indicates the name of a task field or formula, which value will be displayed as text above the bar.

**`property`** {GC.Spread.Sheets.GanttSheet.TextStyle} [topTextStyle] Indicates the the style of the taskbar's left task field.

**`property`** {string} [bottomText] Indicates the name of a task field or formula, which value will be displayed as text below the bar.

**`property`** {GC.Spread.Sheets.GanttSheet.TextStyle} [bottomTextStyle] Indicates the the style of the taskbar's left task field.

**`property`** {string} [insideText] Indicates the name of a task field or formula, which value will be displayed as text inside the bar.

**`property`** {GC.Spread.Sheets.GanttSheet.TextStyle} [insideTextStyle] Indicates the the style of the taskbar's left task field.

#### Type declaration

| Name | Type |
| :------ | :------ |
| `bottomText?` | `string` |
| `bottomTextStyle?` | [`TextStyle`](GC.Spread.Sheets.GanttSheet#textstyle) |
| `endColor?` | [`ColorString`](GC.Data#colorstring) |
| `endShape?` | [`TaskbarEndShape`](GC.Spread.Sheets.GanttSheet#taskbarendshape) |
| `endType?` | [`TaskbarEndType`](GC.Spread.Sheets.GanttSheet#taskbarendtype) |
| `insideText?` | `string` |
| `insideTextStyle?` | [`TextStyle`](GC.Spread.Sheets.GanttSheet#textstyle) |
| `leftText?` | `string` |
| `leftTextStyle?` | [`TextStyle`](GC.Spread.Sheets.GanttSheet#textstyle) |
| `middleColor?` | [`ColorString`](GC.Data#colorstring) |
| `middlePattern?` | [`TaskbarFillPattern`](GC.Spread.Sheets.GanttSheet#taskbarfillpattern) |
| `middleShape?` | [`TaskbarMiddleShape`](GC.Spread.Sheets.GanttSheet#taskbarmiddleshape) |
| `rightText?` | `string` |
| `rightTextStyle?` | [`TextStyle`](GC.Spread.Sheets.GanttSheet#textstyle) |
| `startColor?` | [`ColorString`](GC.Data#colorstring) |
| `startShape?` | [`TaskbarEndShape`](GC.Spread.Sheets.GanttSheet#taskbarendshape) |
| `startType?` | [`TaskbarEndType`](GC.Spread.Sheets.GanttSheet#taskbarendtype) |
| `topText?` | `string` |
| `topTextStyle?` | [`TextStyle`](GC.Spread.Sheets.GanttSheet#textstyle) |

___

### <a id="taskbarstylerulename" name="taskbarstylerulename"></a> TaskbarStyleRuleName

Ƭ **TaskbarStyleRuleName**: ``"projectSummary"`` \| ``"summary"`` \| ``"manualSummary"`` \| ``"task"`` \| ``"manualTask"`` \| ``"milestone"`` \| ``"manualMilestone"`` \| ``"progress"`` \| ``"manualProgress"`` \| ``"startOnly"`` \| ``"finishOnly"`` \| ``"durationOnly"`` \| ``"startOnlyMilestone"`` \| ``"finishOnlyMilestone"`` \| ``"durationOnlyMilestone"``

**`description`** Represents the names for built-in taskbar style rules. Used for project.taskStyleRules.getRule method.

___

### <a id="textstyle" name="textstyle"></a> TextStyle

Ƭ **TextStyle**: `Object`

Represents the text style for timescale and task bars on GanttChart.

**`property`** {string} [font] Indicates the font of text.

**`property`** {GC.Data.ColorString} [color] Indicates the color of text.

**`property`** {GC.Spread.Sheets.TextDecorationType} [textDecoration] Indicates the decoration of text.

#### Type declaration

| Name | Type |
| :------ | :------ |
| `color?` | [`ColorString`](GC.Data#colorstring) |
| `font?` | `string` |
| `textDecoration?` | [`TextDecorationType`](../enums/GC.Spread.Sheets.TextDecorationType) |

___

### <a id="time" name="time"></a> Time

Ƭ **Time**: `Object`

Represents a time value that contains hours and minutes.

**`property`** {number} hour Indicates the hours for this time. Could be 0 to 24.

**`property`** {number} minute Indicates the minutes for this time. Could be 0 to 59.

#### Type declaration

| Name | Type |
| :------ | :------ |
| `hour` | `number` |
| `minute` | `number` |

___

### <a id="timescalelabelformatter" name="timescalelabelformatter"></a> TimescaleLabelFormatter

Ƭ **TimescaleLabelFormatter**: (`date`: `Date`, `project`: [`Project`](../classes/GC.Spread.Sheets.GanttSheet.Project)) => `string`

#### Type declaration

▸ (`date`, `project`): `string`

This callback is used to format timescale labels.

##### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `date` | `Date` | Specifies the date to be formatted. |
| `project` | [`Project`](../classes/GC.Spread.Sheets.GanttSheet.Project) | The project of this timescale. Could use the start date, calendar settings, or other data in the formatting. |

##### Returns

`string`

___

### <a id="workday" name="workday"></a> WorkDay

Ƭ **WorkDay**: [`WorkTime`](GC.Spread.Sheets.GanttSheet#worktime)[]

Represents the work periods in one day.

___

### <a id="worktime" name="worktime"></a> WorkTime

Ƭ **WorkTime**: `Object`

Represents a work period in one day defined by a start time and end time.

**`property`** {GC.Spread.Sheets.GanttSheet.Time} start Indicates the start time. Could be 0:00 to 23:59.

**`property`** {GC.Spread.Sheets.GanttSheet.Time} end Indicates the end time. Could be 0:01 t0 24:00.

#### Type declaration

| Name | Type |
| :------ | :------ |
| `end` | [`Time`](GC.Spread.Sheets.GanttSheet#time) |
| `start` | [`Time`](GC.Spread.Sheets.GanttSheet#time) |
