AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.scales.GanttDateTime Improve this Doc

Extends: anychart.core.Base

The GanttDateTime class contains methods for configuring DateTime scale on the Gantt chart.

Methods Overview

Specific settings
fiscalYearStartMonth()Scale fiscal year start month.
getRange()Gets minimum and maximum visible dates set for a scale.
getTotalRange()Gets total minimum and maximum dates set for a scale.
inverseTransform()Processes reverse transformation of the ratio backward to value.
maxTicksCount()Maximum ticks count.
maximum()Scale maximum.
maximumGap()Getter for the maximum gap.
minimum()Scale minimum.
minimumGap()Getter for the minimum gap.
softMaximum()Soft maximum settings.
softMinimum()Soft minimum settings.
transform()Transforms values to ratio.
zoomLevels()Zoom level settings.

Methods Description

fiscalYearStartMonth

Getter for the scale fiscal year start month.

Returns:

number - Numeric month representation (1 is January, 12 is December)
Setter for the scale fiscal year start month.

Params:

NameTypeDescription
valuenumberScale fiscal year start month value to set. 1 is January, 12 is December, etc.

Returns:

anychart.scales.GanttDateTime - Self instance for method chaining.

getRange

Gets minimum and maximum visible dates set for a scale.

Returns:

Object.<string, number> - An object with min and max keys.

getTotalRange

Gets total minimum and maximum dates set for a scale.

Returns:

Object.<string, number> - An object with min and max keys.

inverseTransform

Processes reverse transformation of the ratio backward to value.

Params:

NameTypeDescription
rationumberRatio to transform.

Returns:

number - Ratio transformed to timestamp.

maxTicksCount

Getter for the scale maximum ticks count.

Returns:

number - The scale maximum ticks count.
See listing
var scale = chart.xScale();
var count = scale.maxTicksCount();
Setter for the scale maximum ticks count.

Params:

NameTypeDefaultDescription
countnumber
200
Scale maximum ticks count value to set.

Returns:

anychart.scales.GanttDateTime - Self instance for method chaining.

maximum

Getter for the scale maximum.

Returns:

number - The scale maximum value.
See listing
var scale = chart.xScale();
var maximum = scale.maximum();
Setter for the scale maximum.

Params:

NameTypeDescription
maximumnumberScale maximum value to set.

Returns:

anychart.scales.GanttDateTime - Self instance for method chaining.

maximumGap

Getter for the maximum gap. NOTE: For backward compatibility:
- if the gap was set as 'pixel gap', method returns an object defined as anychart.scales.GanttDateTime.Gap.
- if the gap was set as 'percent gap', method returns a number representing a ratio-gap as it was before feature implementation.

Returns:

number | anychart.scales.GanttDateTime.Gap - The minimum gap value.
Setter for the maximum gap.

Params:

NameTypeDescription
gapnumber | anychart.scales.GanttDateTime.GapGap value to be set. Can take numeric value or an object defined as anychart.scales.GanttDateTime.Gap.
treatAsPixelsbooleanWhether to treat first parameter numeric value as pixels.

Returns:

anychart.scales.GanttDateTime - Self instance for method chaining.

minimum

Getter for the scale minimum.

Returns:

number - The scale minimum value.
See listing
var scale = chart.xScale();
var minimum = scale.minimum();
Setter for the scale minimum.

Params:

NameTypeDescription
minimumnumberScale minimum value to set.

Returns:

anychart.scales.GanttDateTime - Self instance for method chaining.

minimumGap

Getter for the minimum gap.
NOTE: For backward compatibility:
- if the gap was set as 'pixel gap', method returns an object defined as anychart.scales.GanttDateTime.Gap.
- if the gap was set as 'percent gap', method returns a number representing a ratio-gap as it was before feature implementation.

Returns:

number | anychart.scales.GanttDateTime.Gap - The minimum gap value.
Setter for the minimum gap.

Params:

NameTypeDescription
gapnumber | anychart.scales.GanttDateTime.GapGap value to be set. Can take numeric value or an object defined as anychart.scales.GanttDateTime.Gap.
treatAsPixelsbooleanWhether to treat first parameter numeric value as pixels.

Returns:

anychart.scales.GanttDateTime - Self instance for method chaining.

softMaximum

Getter for the scale soft maximum.

Returns:

number - The soft maximum value.
See listing
var scale = chart.xScale();
var softMax = scale.softMaximum();
Setter for the scale soft maximum.

Params:

NameTypeDescription
maximumnumberSoft maximum value to set.

Returns:

anychart.scales.GanttDateTime - Self instance for method chaining.

softMinimum

Getter for the scale soft minimum.

Returns:

number - The soft minimum value.
See listing
var scale = chart.xScale();
var softMin = scale.softMinimum();
Setter for the scale soft minimum.

Params:

NameTypeDescription
minimumnumberSoft minimum value to set.

Returns:

anychart.scales.GanttDateTime - Self instance for method chaining.

transform

Transforms values to ratio.

Params:

NameTypeDescription
value*Value to transform.

Returns:

number - Value to ratio.

zoomLevels

Getter for zoom levels settings.
Setter for zoom levels settings.
The method sets the sets of labels by which the header is built.

Params:

NameTypeDescription
settingsanychart.scales.GanttDateTime.ZoomLevelsSettingsZoom levels settings to set.

Returns:

anychart.scales.GanttDateTime - Self instance for method chaining.