# GC.Spread.Sheets.GanttSheet.Timescale

## Content

# Class: Timescale

[Sheets](../modules/GC.Spread.Sheets).[GanttSheet](../modules/GC.Spread.Sheets.GanttSheet).Timescale

## Table of contents

### Constructors

- [constructor](GC.Spread.Sheets.GanttSheet.Timescale#constructor)

### Properties

- [autoFitMode](GC.Spread.Sheets.GanttSheet.Timescale#autofitmode)
- [bottomTier](GC.Spread.Sheets.GanttSheet.Timescale#bottomtier)
- [currentDate](GC.Spread.Sheets.GanttSheet.Timescale#currentdate)
- [margin](GC.Spread.Sheets.GanttSheet.Timescale#margin)
- [maxDate](GC.Spread.Sheets.GanttSheet.Timescale#maxdate)
- [middleTier](GC.Spread.Sheets.GanttSheet.Timescale#middletier)
- [minDate](GC.Spread.Sheets.GanttSheet.Timescale#mindate)
- [nonWorkingTime](GC.Spread.Sheets.GanttSheet.Timescale#nonworkingtime)
- [showScaleSeparator](GC.Spread.Sheets.GanttSheet.Timescale#showscaleseparator)
- [tierMode](GC.Spread.Sheets.GanttSheet.Timescale#tiermode)
- [timescaleBottomTierTextStyle](GC.Spread.Sheets.GanttSheet.Timescale#timescalebottomtiertextstyle)
- [timescaleMiddleTierTextStyle](GC.Spread.Sheets.GanttSheet.Timescale#timescalemiddletiertextstyle)
- [timescaleTopTierTextStyle](GC.Spread.Sheets.GanttSheet.Timescale#timescaletoptiertextstyle)
- [topTier](GC.Spread.Sheets.GanttSheet.Timescale#toptier)
- [zoomFactor](GC.Spread.Sheets.GanttSheet.Timescale#zoomfactor)

### Methods

- [scroll](GC.Spread.Sheets.GanttSheet.Timescale#scroll)
- [scrollBy](GC.Spread.Sheets.GanttSheet.Timescale#scrollby)
- [scrollOneTick](GC.Spread.Sheets.GanttSheet.Timescale#scrollonetick)
- [scrollTo](GC.Spread.Sheets.GanttSheet.Timescale#scrollto)
- [zoomAuto](GC.Spread.Sheets.GanttSheet.Timescale#zoomauto)
- [zoomIn](GC.Spread.Sheets.GanttSheet.Timescale#zoomin)
- [zoomOut](GC.Spread.Sheets.GanttSheet.Timescale#zoomout)
- [zoomTo](GC.Spread.Sheets.GanttSheet.Timescale#zoomto)
- [zoomToRange](GC.Spread.Sheets.GanttSheet.Timescale#zoomtorange)

## Constructors

### <a id="constructor" name="constructor"></a> constructor

• **new Timescale**()

Creates a timescale for project. Internal used only.

**`classdesc`** Represents the timescale of GanttChart.

## Properties

### <a id="autofitmode" name="autofitmode"></a> autoFitMode

• **autoFitMode**: [`TimeScaleAutoFitMode`](../modules/GC.Spread.Sheets.GanttSheet#timescaleautofitmode)

Gets or sets the auto-fit mode of the timescale. When set to "project", the minDate and maxDate will be automatically adjusted to the project's actual date range after each schedule. The default value is "none".

___

### <a id="bottomtier" name="bottomtier"></a> bottomTier

• **bottomTier**: [`TimescaleTier`](GC.Spread.Sheets.GanttSheet.TimescaleTier)

Gets the bottom tier of the timescale.

**`readonly`**

___

### <a id="currentdate" name="currentdate"></a> currentDate

• **currentDate**: `Date`

Gets the current date for the timescale. To change it, call scroll functions of timescale.

**`readonly`**

___

### <a id="margin" name="margin"></a> margin

• **margin**: `number`

Gets or sets the margin of the timescale. The margin extends the scrollable range before minDate and after maxDate by the specified number of minimum tier units. The default value is 0.

___

### <a id="maxdate" name="maxdate"></a> maxDate

• **maxDate**: `Date`

Gets or sets the maximum date of the scrollable area of the timescale. The default value is 2030-1-1.

___

### <a id="middletier" name="middletier"></a> middleTier

• **middleTier**: [`TimescaleTier`](GC.Spread.Sheets.GanttSheet.TimescaleTier)

Gets the middle tier of the timescale.

**`readonly`**

___

### <a id="mindate" name="mindate"></a> minDate

• **minDate**: `Date`

Gets or sets the minimum date of the scrollable area of the timescale. The default value is 2020-1-1.

___

### <a id="nonworkingtime" name="nonworkingtime"></a> nonWorkingTime

• **nonWorkingTime**: [`NonWorkingTimeStyle`](GC.Spread.Sheets.GanttSheet.NonWorkingTimeStyle)

Gets the non working time area of the timescale.

**`readonly`**

___

### <a id="showscaleseparator" name="showscaleseparator"></a> showScaleSeparator

• **showScaleSeparator**: `boolean`

Gets or sets a boolean value that indicates whether show the scale separator line between top tier and middle tier.

___

### <a id="tiermode" name="tiermode"></a> tierMode

• **tierMode**: [`TimescaleTierMode`](../enums/GC.Spread.Sheets.GanttSheet.TimescaleTierMode)

Gets or sets the tier mode for the timescale.

___

### <a id="timescalebottomtiertextstyle" name="timescalebottomtiertextstyle"></a> timescaleBottomTierTextStyle

• **timescaleBottomTierTextStyle**: [`TextStyle`](../modules/GC.Spread.Sheets.GanttSheet#textstyle)

Gets or sets the text style for bottom tier labels of timescales.

___

### <a id="timescalemiddletiertextstyle" name="timescalemiddletiertextstyle"></a> timescaleMiddleTierTextStyle

• **timescaleMiddleTierTextStyle**: [`TextStyle`](../modules/GC.Spread.Sheets.GanttSheet#textstyle)

Gets or sets the text style for middle tier labels of timescales.

___

### <a id="timescaletoptiertextstyle" name="timescaletoptiertextstyle"></a> timescaleTopTierTextStyle

• **timescaleTopTierTextStyle**: [`TextStyle`](../modules/GC.Spread.Sheets.GanttSheet#textstyle)

Gets or sets the text style for top tier labels of timescales.

___

### <a id="toptier" name="toptier"></a> topTier

• **topTier**: [`TimescaleTier`](GC.Spread.Sheets.GanttSheet.TimescaleTier)

Gets the top tier of the timescale.

**`readonly`**

___

### <a id="zoomfactor" name="zoomfactor"></a> zoomFactor

• **zoomFactor**: `number`

Gets a number value that indicates the zoom factor for timescale. To change it, call zoom functions of timescale.

**`readonly`**

## Methods

### <a id="scroll" name="scroll"></a> scroll

▸ **scroll**(`pixels`): `void`

Scrolls the timescale in pixels. Note timescale will scroll to the nearest tick.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `pixels` | `number` | Indicates the pixels to scroll. Positive number indicates scroll forward, and negative number indicates scroll backward. |

#### Returns

`void`

___

### <a id="scrollby" name="scrollby"></a> scrollBy

▸ **scrollBy**(`count`, `unit`): `void`

Scrolls the timescale by the specified count of units. Note timescale will scroll to the nearest tick.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `count` | `number` | Indicates the time in specified units to scroll. Positive number indicates scroll forward, and negative number indicates scroll backward. |
| `unit` | [`TimescaleUnit`](../enums/GC.Spread.Sheets.GanttSheet.TimescaleUnit) | Indicates the unit for count value. |

#### Returns

`void`

___

### <a id="scrollonetick" name="scrollonetick"></a> scrollOneTick

▸ **scrollOneTick**(`forward`): `void`

Scrolls the timescale by one tick.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `forward` | `boolean` | A boolean value that indicates to scroll forward or backward. |

#### Returns

`void`

___

### <a id="scrollto" name="scrollto"></a> scrollTo

▸ **scrollTo**(`date`, `percentOfViewport?`): `void`

Scrolls the timescale to the specified date. Note timescale will scroll to the nearest tick.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `date` | `Date` | A Date value indicates the scroll target. |
| `percentOfViewport?` | `number` | - |

#### Returns

`void`

___

### <a id="zoomauto" name="zoomauto"></a> zoomAuto

▸ **zoomAuto**(): `void`

Zooms the timescale to suitable factor according to the labels of ticks on each tiers automatically.

#### Returns

`void`

___

### <a id="zoomin" name="zoomin"></a> zoomIn

▸ **zoomIn**(`adjustTierUnit?`): `void`

Zooms in the timescale to the next level.

#### Parameters

| Name | Type |
| :------ | :------ |
| `adjustTierUnit?` | `boolean` |

#### Returns

`void`

___

### <a id="zoomout" name="zoomout"></a> zoomOut

▸ **zoomOut**(`adjustTierUnit?`): `void`

Zooms out the timescale to the next level.

#### Parameters

| Name | Type |
| :------ | :------ |
| `adjustTierUnit?` | `boolean` |

#### Returns

`void`

___

### <a id="zoomto" name="zoomto"></a> zoomTo

▸ **zoomTo**(`zoomFactor`, `adjustTierUnit?`): `void`

Zooms the timescale to the specified factor.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `zoomFactor` | `number` | A number value indicates the target zoom factor. |
| `adjustTierUnit?` | `boolean` | - |

#### Returns

`void`

___

### <a id="zoomtorange" name="zoomtorange"></a> zoomToRange

▸ **zoomToRange**(`start`, `end`, `adjustTierUnit?`): `void`

Zooms the timescale to display the target date range in viewport. Note timescale will adjust to the nearest ticks.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `start` | `Date` | A date value indicates the start of data range to display. |
| `end` | `Date` | A date value indicates the end of data range to display. |
| `adjustTierUnit?` | `boolean` | - |

#### Returns

`void`
