[]
        
(Showing Draft Content)

GC.Spread.Sheets.GanttSheet.Timescale

Class: Timescale

Sheets.GanttSheet.Timescale

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Timescale()

Creates a timescale for project. Internal used only.

classdesc Represents the timescale of GanttChart.

Properties

bottomTier

bottomTier: TimescaleTier

Gets the bottom tier of the timescale.

readonly


currentDate

currentDate: Date

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

readonly


maxDate

maxDate: Date

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


middleTier

middleTier: TimescaleTier

Gets the middle tier of the timescale.

readonly


minDate

minDate: Date

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


nonWorkingTime

nonWorkingTime: NonWorkingTimeStyle

Gets the non working time area of the timescale.

readonly


showScaleSeparator

showScaleSeparator: boolean

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


tierMode

tierMode: TimescaleTierMode

Gets or sets the tier mode for the timescale.


timescaleBottomTierTextStyle

timescaleBottomTierTextStyle: TextStyle

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


timescaleMiddleTierTextStyle

timescaleMiddleTierTextStyle: TextStyle

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


timescaleTopTierTextStyle

timescaleTopTierTextStyle: TextStyle

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


topTier

topTier: TimescaleTier

Gets the top tier of the timescale.

readonly


zoomFactor

zoomFactor: number

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

readonly

Methods

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


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 Indicates the unit for count value.

Returns

void


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


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


zoomAuto

zoomAuto(): void

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

Returns

void


zoomIn

zoomIn(adjustTierUnit?): void

Zooms in the timescale to the next level.

Parameters

Name Type
adjustTierUnit? boolean

Returns

void


zoomOut

zoomOut(adjustTierUnit?): void

Zooms out the timescale to the next level.

Parameters

Name Type
adjustTierUnit? boolean

Returns

void


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


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