GanttCategoryAxis

Type class

The vertical axis of a Gantt chart: the editable task list, with subtasks, duration steppers and progress pies.

Click here for more info
@since 5.14.0

Data item

GanttCategoryAxis uses data items of type IGanttCategoryAxisDataItem.

Sources

GanttCategoryAxis can be used (imported) via one of the following packages.

// Import GanttCategoryAxis
import * as am5gantt from "@amcharts/amcharts5/gantt";

// Create GanttCategoryAxis
am5gantt.GanttCategoryAxis.new(root, {
  // ... config if applicable
});
<!-- Load GanttCategoryAxis -->
<script src="gantt.js"></script>

<script>
// Create GanttCategoryAxis
am5gantt.GanttCategoryAxis.new(root, {
  // ... config if applicable
});
</script>

Inheritance

GanttCategoryAxis extends CategoryAxis.

GanttCategoryAxis is not extended by any other symbol.

Settings

Set these settings on a GanttCategoryAxis object using its set() and setAll() methods.

Read about settings concept.

active
#

Type undefined | false | true

Inherited from ISpriteSettings

Applies the element's "active" state while true.

animations
#

Type Array

Inherited from IEntitySettings

Animations the element plays on its own, described as data - so they can be set from a JSON config and saved with it.

Each one animates a setting of the element (or, with target: "dataItem", a value of its data item - a map point's positionOnLine, say). They start when the setting is applied, restart when it changes, and stop when the element is disposed. A saved config keeps what was configured, never a value caught half way through an animation.

sprite.set("animations", [
  { key: "rotation", to: 360, duration: 4000, loops: 0 },
  { key: "scale", from: 1, to: 1.3, duration: 800, loops: 0, yoyo: true, easing: "sine" }
]);

@since 5.20.8

appearDelay
#

Type undefined | number

Default 0

Inherited from ISpriteSettings

Milliseconds to wait before the autoAppear animation starts. The element stays hidden until then.

@since 5.21.0

appearDuration
#

Type undefined | number

Inherited from ISpriteSettings

Duration of the autoAppear animation, in milliseconds. Without it, the element's stateAnimationDuration is used.

@since 5.21.0

ariaChecked
#

Type undefined | false | true

Inherited from ISpriteSettings

aria-checked setting.

This setting is ignored unless role is one of the following:

  • "checkbox"
  • "option"
  • "radio"
  • "menuitemcheckbox"
  • "menuitemradio"
  • "treeitem" On a toggle "button" (one with toggleKey) it is exposed as aria-pressed.

ariaControls
#

Type undefined | string

Inherited from ISpriteSettings

aria-controls setting.

ariaCurrent
#

Type undefined | string

Inherited from ISpriteSettings

aria-current setting.

Click here for more info
@since 5.9.8

ariaExpanded
#

Type undefined | false | true

Inherited from ISpriteSettings

aria-expanded setting: whether the content the element shows or hides (e.g. a task's subtasks, a node's children) is shown.

Click here for more info
@since 5.21.0

ariaHidden
#

Type undefined | false | true

Inherited from ISpriteSettings

aria-hidden setting.

ariaLabel
#

Type undefined | string

Inherited from ISpriteSettings

Label for the element to use for screen readers.

Click here for more info

ariaLive
#

Type AriaLive

Inherited from ISpriteSettings

aria-live setting.

ariaOrientation
#

Type undefined | string

Inherited from ISpriteSettings

aria-orientation setting.

ariaSelected
#

Type undefined | false | true

Inherited from ISpriteSettings

aria-selected setting.

Click here for more info
@since 5.9.8

ariaValueMax
#

Type undefined | string

Inherited from ISpriteSettings

aria-valuemax setting.

ariaValueMin
#

Type undefined | string

Inherited from ISpriteSettings

aria-valuemin setting.

ariaValueNow
#

Type undefined | string

Inherited from ISpriteSettings

aria-valuenow setting.

ariaValueText
#

Type undefined | string

Inherited from ISpriteSettings

aria-valuetext setting.

autoAppear
#

Type undefined | false | true

Default false

Inherited from ISpriteSettings

Plays the element's reveal animation, as appear() does, when it is first drawn: a chart fades in, a series grows its columns or lines from the base. A series waits for its first data. It plays once: data updates do not replay it, but turning the setting off and on again does.

Elements made from a template play as each one is made.

An element that starts hidden (visible: false, or hidden in code before it is drawn) stays hidden. An animations entry on the same setting, such as a pulsing opacity, keeps playing.

This is how a JSON config gets the opening animation, as a config cannot call appear().

chart.setAll({ autoAppear: true, appearDuration: 1000, appearDelay: 100 });
series.setAll({ autoAppear: true, appearDuration: 1000 });
chart.setAll({ autoAppear: true, appearDuration: 1000, appearDelay: 100 });
series.setAll({ autoAppear: true, appearDuration: 1000 });

Click here for more info
@since 5.21.0

background
#

Type Graphics

Inherited from IContainerSettings

Element drawn behind the container's content, sized to fill the container.

Click here for more info

baseValue
#

Type undefined | number

Inherited from IAxisSettings

Base value of the axis.

blur
#

Type undefined | number

Inherited from ISpriteSettings

Blur radius in pixels, from 0 (no blur) up.

IMPORTANT: This setting is not supported in Safari browsers.

Click here for more info
@since 5.5.0

brightness
#

Type undefined | number

Inherited from ISpriteSettings

Brightness.

  • 0 - completely black
  • 1 - no changes (default)
  • >1 - brighter IMPORTANT: This setting is not supported in Safari browsers.

Click here for more info
@since 5.5.0

bullet
#

Type undefined | ( root: Root, axis: Axis, dataItem: DataItem) => AxisBullet

Inherited from IAxisSettings

Function that creates an AxisBullet for each of the axis's cells, such as each category. Axis ranges get none.

Click here for more info

categoryField
#

Type string

Inherited from ICategoryAxisSettings

Field in the data that holds the category names.

cellSizeField
#

Type undefined | string

Inherited from ICategoryAxisSettings

Field in the data that holds each category's relative size: a category of 2 takes twice the room of one of 1. Categories without it get 1.

centerX
#

Type number | Percent

Inherited from ISpriteSettings

The point of the element that is placed at its x position, and that it rotates and scales around: pixels from its left edge, or a percent of its width.

centerY
#

Type number | Percent

Inherited from ISpriteSettings

The point of the element that is placed at its y position, and that it rotates and scales around: pixels from its top edge, or a percent of its height.

childCellSize
#

Type undefined | number

Default 0.8

Row height of a subtask relative to its parent's row, 0 to 1. Each deeper level shrinks by the same factor again.

Click here for more info

childShift
#

Type undefined | number

Default 25

Indent in pixels of a subtask's label, per level of depth.

Click here for more info

clickAnnounceText
#

Type undefined | string

Inherited from ISpriteSettings

If set, the text will be read out (announced) by a screen reader when focused element is "clicked" (by pressing ENTER or SPACE).

@since 5.10.8

collapsedField
#

Type undefined | string

Default "collapsed"

Field in data that holds whether the task's subtasks are collapsed.

Click here for more info

colorField
#

Type undefined | string

Default "color"

Field in data that holds the task color.

contrast
#

Type undefined | number

Inherited from ISpriteSettings

Contrast.

  • 0 - completely gray
  • 1 - no changes (default)
  • >1 - more contrast IMPORTANT: This setting is not supported in Safari browsers.

Click here for more info
@since 5.5.0

crisp
#

Type undefined | false | true

Default false

Inherited from ISpriteSettings

Draws the element sharply, with minimal anti-aliasing: its position is rounded to whole pixels, and strokeWidth is adjusted to the device pixel ratio, so lines may look thinner than expected.

NOTE: it may not work well on several elements that are meant to fit together exactly.

@since 5.3.0

cursorOverStyle
#

Type undefined | string

Inherited from ISpriteSettings

CSS cursor to show while the pointer is over the element, e.g.

"pointer".

Click here for more info

dateFormatter
#

Type DateFormatter | undefined

Inherited from ISpriteSettings

A DateFormatter to use for this element instead of the root's.

Click here for more info

disabled
#

Type undefined | false | true

Inherited from ISpriteSettings

Applies the element's "disabled" state while true. It changes only the look: the element still responds to the pointer.

draggable
#

Type undefined | false | true

Inherited from ISpriteSettings

Lets the user drag the element. Touches that start on it no longer scroll the page.

durationFormatter
#

Type DurationFormatter | undefined

Inherited from ISpriteSettings

A DurationFormatter to use for this element instead of the root's.

Click here for more info

dx
#

Type undefined | number

Inherited from ISpriteSettings

Horizontal shift in pixels. Can be negative to shift leftward.

dy
#

Type undefined | number

Inherited from ISpriteSettings

Vertical shift in pixels. Can be negative to shift upward.

end
#

Type undefined | number

Default 1

Inherited from IAxisSettings

End of the visible (zoomed) part of the axis: 0 is the start of the axis, 1 the end. Set it to pre-zoom: 0.9 hides the last 10%.

Click here for more info

endLocation
#

Type undefined | number

Default 1

Inherited from ICategoryAxisSettings

Where within the last category the axis ends, from 0 (its start) to 1 (its end): 0.5 cuts off the second half of the last category.

exportable
#

Type undefined | false | true

Inherited from ISpriteSettings

If false, the element is left out of exported images of the chart.

fillRule
#

Type undefined | ( dataItem: DataItem, index: undefined | number) => void

Inherited from ICategoryAxisSettings

Function that decides which axis fills show; it is called for each category with its index. The default fills every other category.

Click here for more info

fixAxisSize
#

Type undefined | false | true

Default true

Inherited from IAxisSettings

Keeps the axis from shrinking as zooming changes the visible labels: it keeps room for the widest label shown so far.

focusable
#

Type undefined | false | true

Inherited from ISpriteSettings

Can element be focused, i.e. selected using TAB key.

Click here for more info

focusableGroup
#

Type string | number

Inherited from ISpriteSettings

An identifier by which to group common elements into focusable groups.

If set, only the first element in he group will be focusable via TAB key.

When it is selected, the rest of the elements in the same group can be selected using arrow keys.

It allows users to TAB-through chart elements quickly without the need to TAB into each and every element.

It's up to implementer of the charts to provide meaningful ariaLabel to the element, which advertises this capability and provides adequate instructions.

Click here for more info
@since 5.0.6

forceHidden
#

Type undefined | false | true

Inherited from ISpriteSettings

Hides the element whatever its visible setting, even when show() is called.

forceInactive
#

Type undefined | false | true

Inherited from ISpriteSettings

Makes the element and its children ignore the pointer, even with interactive: true or event listeners set.

@since 5.0.21

height
#

Type number | Percent | null

Inherited from ISpriteSettings

Height in pixels, or a Percent of the parent's inner height. In a vertical layout, a percent height is a share of the height the other children leave.

hoverOnFocus
#

Type undefined | false | true

Inherited from ISpriteSettings

Simulate hover on an element when it gains focus, including changing hover appearance and displaying a tooltip if applicable.

Click here for more info

html
#

Type undefined | string

Inherited from IContainerSettings

HTML content of the container. It can hold data placeholders, such as {category}.

Click here for more info
@since 5.2.11

hue
#

Type undefined | number

Inherited from ISpriteSettings

Rotates the hue of all colors by this many degrees, from 0 to 360.

IMPORTANT: This setting is not supported in Safari browsers.

Click here for more info
@since 5.5.0

id
#

Type undefined | string

Inherited from IEntitySettings

A unique ID for looking the element up in root.entitiesById. Setting an ID that another element already has throws an error.

idField
#

Type undefined | string

Inherited from ICategoryAxisSettings

Field in the data that holds a unique id for each category.

ignoreThemes
#

Type undefined | false | true

Default false

Inherited from IEntitySettings

Ignores themes: no theme rule applies to the element, not even one of the default theme.

@since 5.15.6

interactive
#

Type undefined | false | true

Inherited from ISpriteSettings

Makes the element respond to the pointer. Adding a pointer event listener to it turns this on.

interactiveChildren
#

Type undefined | false | true

Default true

Inherited from IContainerSettings

Makes every descendant, not just direct children, interactive when the container itself is interactive.

interpolationDuration
#

Type undefined | number

Default 0

Inherited from IComponentSettings

Duration in milliseconds of the animation from old values to new ones, e.g. when data changes.

Click here for more info

interpolationEasing
#

Type $ease.Easing

Inherited from IComponentSettings

Easing function of the animation from old values to new ones.

Click here for more info

invert
#

Type undefined | number

Inherited from ISpriteSettings

Color inversion, from 0 (no changes) to 1 (fully inverted colors).

IMPORTANT: This setting is not supported in Safari browsers.

Click here for more info
@since 5.5.0

isMeasured
#

Type undefined | false | true

Default true

Inherited from ISpriteSettings

If false, the element's bounds are not measured, so it takes no part in its parent's layout or size.

layer
#

Type undefined | number

Inherited from ISpriteSettings

Layer to draw the element on: elements on higher layers show in front of those on lower ones. If not set, the element is on its parent's layer.

layerMargin
#

Type IMargin

Inherited from ISpriteSettings

Margins in pixels that make the element's layer larger than the chart, or, when negative, smaller.

@since @5.2.39

layout
#

Type Layout | null

Inherited from IContainerSettings

How children are arranged, e.g. root.horizontalLayout, root.verticalLayout or root.gridLayout. Without a layout, children are placed by their own x and y.

Click here for more info

marginBottom
#

Type undefined | number

Inherited from ISpriteSettings

Bottom margin in pixels.

marginLeft
#

Type undefined | number

Inherited from ISpriteSettings

Left margin in pixels.

marginRight
#

Type undefined | number

Inherited from ISpriteSettings

Right margin in pixels.

marginTop
#

Type undefined | number

Inherited from ISpriteSettings

Top margin in pixels.

mask
#

Type Graphics | null

Inherited from IContainerSettings

An element whose shape clips the container's children.

Click here for more info

maskContent
#

Type undefined | false | true

Inherited from IContainerSettings

Clips all content that goes outside the container's bounds.

maxDeviation
#

Type undefined | number

Default 0.1

Inherited from IAxisSettings

How far past its ends the axis can be zoomed or panned, as a share of the visible range: 0.1 is 10%.

Click here for more info

maxHeight
#

Type number | null

Inherited from ISpriteSettings

Maximum allowed height in pixels.

maxWidth
#

Type number | null

Inherited from ISpriteSettings

Maximum allowed width in pixels.

maxZoomCount
#

Type undefined | number

Inherited from IAxisSettings

Most cells to show at a time, such as categories on a CategoryAxis or baseInterval periods on a DateAxis. The axis can't be zoomed out any further.

Click here for more info

maxZoomFactor
#

Type number | null

Default 1000

Inherited from IAxisSettings

Roughly how many times the axis can be zoomed in. A CategoryAxis ignores it and zooms in as far as minZoomCount categories; a DateAxis set to null (its default) zooms in as far as minZoomCount base intervals.

minCellHeight
#

Type undefined | number

Default 70

Minimum row height in pixels. The axis shows only as many rows as fit at this height; scroll to see the rest.

Click here for more info

minHeight
#

Type number | null

Inherited from ISpriteSettings

Minimum allowed height in pixels.

minWidth
#

Type number | null

Inherited from ISpriteSettings

Minimum allowed width in pixels.

minZoomCount
#

Type undefined | number

Inherited from IAxisSettings

Fewest cells to show at a time, such as categories on a CategoryAxis or baseInterval periods on a DateAxis. The axis can't be zoomed in any further.

Click here for more info

minorAxisFillsEnabled
#

Type undefined | false | true

Inherited from IAxisSettings

Creates axis fills for the cells of the minor grid too, not only the main one. The fillRule still decides which of them show.

@since 5.14.0

nameField
#

Type undefined | string

Default "name"

Field in data that holds the task name.

numberFormatter
#

Type NumberFormatter | undefined

Inherited from ISpriteSettings

A NumberFormatter to use for this element instead of the root's.

Click here for more info

opacity
#

Type undefined | number

Default 1

Inherited from ISpriteSettings

Opacity, from 0 (transparent) to 1 (opaque).

paddingBottom
#

Type undefined | number

Inherited from IContainerSettings

Bottom padding in pixels.

paddingLeft
#

Type undefined | number

Inherited from IContainerSettings

Left padding in pixels.

paddingRight
#

Type undefined | number

Inherited from IContainerSettings

Right padding in pixels.

paddingTop
#

Type undefined | number

Inherited from IContainerSettings

Top padding in pixels.

panX
#

Type undefined | false | true

Inherited from IAxisSettings

false keeps this axis in place when the chart is panned horizontally, by dragging or with the mouse wheel.

Click here for more info

panY
#

Type undefined | false | true

Inherited from IAxisSettings

false keeps this axis in place when the chart is panned vertically, by dragging or with the mouse wheel.

Click here for more info

parentIdField
#

Type undefined | string

Default "parentId"

Field in data that holds the ID of the parent task.

Click here for more info

position
#

Type "absolute" | "relative"

Default "relative"

Inherited from ISpriteSettings

Positioning of the element.

"absolute" leaves the element out of its parent's layout and size: it is placed by its x and y only.

renderer
#

Type R

Inherited from IAxisSettings

The renderer that draws the axis line, labels, ticks, grid and fills:

AxisRendererX for a horizontal axis, AxisRendererY for a vertical one.

Click here for more info

reverseChildren
#

Type undefined | false | true

Inherited from IContainerSettings

Lays out the children in reverse order.

@since 5.1.1

role
#

Type Role

Inherited from ISpriteSettings

Element's role.

Click here for more info

rotation
#

Type undefined | number

Default 0

Inherited from ISpriteSettings

Rotation in degrees, clockwise, around the point set by centerX and centerY.

saturate
#

Type undefined | number

Inherited from ISpriteSettings

Saturation.

  • 0 - grayscale
  • 1 - no changes (default)
  • >1 - more saturated IMPORTANT: This setting is not supported in Safari browsers.

Click here for more info
@since 5.5.0

scale
#

Type undefined | number

Default 1

Inherited from ISpriteSettings

Scale, around the point set by centerX and centerY: below 1 shrinks the element, above 1 enlarges it.

selectedDataItem
#

Type DataItem

The selected task, if any.

sepia
#

Type undefined | number

Inherited from ISpriteSettings

Sepia tone, from 0 (no changes) to 1 (full sepia).

IMPORTANT: This setting is not supported in Safari browsers.

Click here for more info
@since 5.5.0

setStateOnChildren
#

Type undefined | false | true

Default false

Inherited from IContainerSettings

Applies every state set on the container to its children too.

Click here for more info

showTooltipOn
#

Type "hover" | "always" | "click"

Default "hover"

Inherited from ISpriteSettings

When the element's tooltip shows:

  • "hover" (default) - while the pointer is over the element, or after a tap on it until a tap elsewhere.
  • "always" - all the time. To show tooltips of several elements at once, give each its own Tooltip (tooltip).
  • "click" - after a click or tap on the element, until a click anywhere else on the page.

Click here for more info
@since 5.0.16

snapTooltip
#

Type undefined | false | true

Default true

Inherited from IAxisSettings

Snaps the tooltip to tooltipLocation in the cell under the cursor, instead of following the cursor exactly.

start
#

Type undefined | number

Default 0

Inherited from IAxisSettings

Start of the visible (zoomed) part of the axis: 0 is the start of the axis, 1 the end. Set it to pre-zoom: 0.1 hides the first 10%.

Click here for more info

startLocation
#

Type undefined | number

Default 0

Inherited from ICategoryAxisSettings

Where within the first category the axis starts, from 0 (its start) to 1 (its end): 0.5 cuts off the first half of the first category.

stateAnimationDuration
#

Type undefined | number

Default 0

Inherited from IEntitySettings

How long, in milliseconds, a switch from one state to another animates.

0 switches at once.

stateAnimationEasing
#

Type $ease.Easing

Default out(cubic)

Inherited from IEntitySettings

Easing of the animated switch from one state to another.

tabindexOrder
#

Type undefined | number

Inherited from ISpriteSettings

An internal order by which focusable elements will be selected within the chart.

Click here for more info

templateField
#

Type undefined | string

Inherited from ISpriteSettings

Field in the data item's data object that holds settings for this element, applied over its template's.

Click here for more info

themeTags
#

Type Array

Inherited from IEntitySettings

Tags that theme rules can target. They also count for the element's children, so a rule can match a child by a tag of its parent.

Click here for more info

themeTagsSelf
#

Type Array

Inherited from IEntitySettings

Tags that theme rules can target, like themeTags, but only for this element, not its children.

Click here for more info

themes
#

Type Array

Inherited from IEntitySettings

Themes applied to the element and everything inside it.

toggleKey
#

Type "disabled" | "active" | "none" | undefined

Inherited from ISpriteSettings

Setting that a click or tap toggles between true and false:

"active" or "disabled". "none" turns toggling off.

tooltip
#

Type Tooltip

Inherited from IAxisSettings

Tooltip that shows the axis value at the cursor's position.

tooltipHTML
#

Type undefined | string

Inherited from ISpriteSettings

HTML content of the element's tooltip, shown in place of tooltipText.

@since 5.2.11

tooltipLocation
#

Type undefined | number

Default 0.5

Inherited from IAxisSettings

Where within a cell the tooltip snaps to when snapTooltip is on: 0 the cell's start, 0.5 its middle, 1 its end.

tooltipPosition
#

Type "fixed" | "pointer"

Default "fixed"

Inherited from ISpriteSettings

Where the tooltip points: "fixed" at tooltipX and tooltipY, or "pointer" at the pointer, following it.

tooltipText
#

Type undefined | string

Inherited from ISpriteSettings

Text of the element's tooltip. It can hold data placeholders, such as {value}.

tooltipX
#

Type number | Percent

Default am5.percent(50)

Inherited from ISpriteSettings

Where on the element the tooltip points, horizontally: pixels from its left edge, or a percent of its width.

tooltipY
#

Type number | Percent

Default am5.percent(50)

Inherited from ISpriteSettings

Where on the element the tooltip points, vertically: pixels from its top edge, or a percent of its height.

userData
#

Type any

Inherited from IEntitySettings

Any data of your own to keep with the element.

verticalScrollbar
#

Type Scrollbar

Inherited from IContainerSettings

A Scrollbar that scrolls the content vertically when it does not fit in the container.

Click here for more info

visible
#

Type undefined | false | true

Default true

Inherited from ISpriteSettings

Whether the element is shown. Unlike show() and hide(), it does not animate.

wheelable
#

Type undefined | false | true

Inherited from ISpriteSettings

Makes the element receive mouse wheel events. While the pointer is over it, the wheel no longer scrolls the page.

width
#

Type number | Percent | null

Inherited from ISpriteSettings

Width in pixels, or a Percent of the parent's inner width. In a horizontal layout, a percent width is a share of the width the other children leave.

x
#

Type number | Percent | null

Inherited from ISpriteSettings

X position in the parent: pixels from its left edge, or a Percent of its inner width, measured from inside its left padding.

y
#

Type number | Percent | null

Inherited from ISpriteSettings

Y position in the parent: pixels from its top edge, or a Percent of its inner height, measured from inside its top padding.

zoomOut
#

Type undefined | false | true

Default true

Inherited from IAxisSettings

false leaves the axis out of the chart's zoom-out: the zoom-out button doesn't reset it, and zooming it doesn't show the button.

@since 5.14.0

zoomX
#

Type undefined | false | true

Inherited from IAxisSettings

false keeps this axis as it is when the mouse wheel zooms the chart horizontally. The cursor, scrollbars and pinch still zoom it; use zoomable to stop those too.

Click here for more info

zoomY
#

Type undefined | false | true

Inherited from IAxisSettings

false keeps this axis as it is when the mouse wheel zooms the chart vertically. The cursor, scrollbars and pinch still zoom it; use zoomable to stop those too.

Click here for more info

zoomable
#

Type undefined | false | true

Inherited from IAxisSettings

false makes zoom() do nothing, so the cursor, scrollbars, pinch and mouse wheel can't zoom or scroll the axis. Dragging the plot area still pans it.

There are 124 inherited items currently hidden from this list.

Private settings

These are read-only settings accessible from a GanttCategoryAxis object using its getPrivate() method.

Read about private settings.

cellWidth
#

Read only

Type undefined | number

Inherited from IAxisPrivate

Distance in pixels between grid lines (read-only). Approximate on a DateAxis, whose grid can be uneven.

Watch it to resize or hide labels so they don't overlap.

endIndex
#

Read only

Type undefined | number

Inherited from ICategoryAxisPrivate

Index after the last category in view.

focusable
#

Read only

Type undefined | false | true

Inherited from ISpritePrivate

If set to false, its tabindex will be set to -1, so it does not get focused with TAB, regardless whether its public setting focusable is set to true.

@since 5.3.16

htmlElement
#

Read only

Type HTMLDivElement

Inherited from IContainerPrivate

The <div> element that holds the container's html content.

htmlElementWrapper
#

Read only

Type HTMLDivElement

Inherited from IContainerPrivate

A wrapper <div> for htmlElement.

@since 5.11.2

lastTooltipCoords
#

Read only

Type IPoint

Inherited from ISpritePrivate

The last point the tooltip was shown at, so it is not shown again at the same place.

@since 5.11.3

showingTooltip
#

Read only

Type undefined | false | true

Inherited from ISpritePrivate

true while the element shows its tooltip.

startIndex
#

Read only

Type undefined | number

Inherited from ICategoryAxisPrivate

Index of the first category in view.

tooltipPosition
#

Read only

Type undefined | number

Inherited from IAxisPrivate

Position on the axis (0 to 1) the tooltip points to.

tooltipTarget
#

Read only

Type Graphics

Inherited from ISpritePrivate

An element whose tooltip point and colors the tooltip uses, in place of this element's.

trustBounds
#

Read only

Type undefined | false | true

Inherited from ISpritePrivate

Checks that the pointer is within the element's bounds before dispatching "pointerover". This prevents ghost tooltips that sometimes appear while the pointer moves over interactive elements.

It is true by default on Rectangle and Circle.

@since 5.5.0

There are 11 inherited items currently hidden from this list.

Properties

adapters
#

Type Adapters

Default new Adapters(this)

Inherited from Entity

axisHeader
#

Type Container

Default this.children.push(Container.new(this._root,
{
  
themeTags: ["axis",
  "header"],
  
position: "absolute",
  
background: Rectangle.new(this._root,
  {
    
themeTags: ["header",
    "background"],
    
fill: this._root.interfaceColors.get("background")

  })._markC("themeTags",
  "fill")

})._markC("themeTags",
"position",
"background"))

Inherited from Axis

A container for extra content, such as a legend, a label or an icon. It sits above a Y axis, and to the left of an X axis.

Click here for more info

axisRanges
#

Type List

Default new List()

Inherited from Axis

The axis's ranges: highlighted values or spans, each with its own grid, label and fill.

Click here for more info

axisResizer
#

Type Rectangle

bulletsContainer
#

Type Container

Default this.children.push(Container.new(this._root,
{
  isMeasured: false,
  width: p100,
  height: p100,
  position: "absolute"
}))

Inherited from Axis

Holds the axis's bullets.

chart
#

Type XYChart | undefined

Inherited from Axis

The chart the axis belongs to.

children
#

Type Children

Default new Children(this)

Inherited from Container

The container's child elements.

className
#

Static

Type string

Default "GanttCategoryAxis"

classNames
#

Static

Type Array

Default "GanttCategoryAxis", "CategoryAxis", "Axis", "Component", "Container", "Sprite", "Entity"

data
#

Type ListData

Inherited from Component

The component's data: a list of data objects, each made into a data item.

Click here for more info

dataItem
#

Type DataItem | undefined

Inherited from Sprite

The element's DataItem, or, if it has none, its nearest parent's.

NOTE: data items are assigned automatically in most cases where it matters. Set one only if you know what you are doing.

dataItems
#

Type Array

Inherited from Component

The component's data items.

enableDispose
#

Type boolean

Default true

Inherited from Settings

Set to false to make dispose() do nothing.

events
#

Type SpriteEventDispatcher

Inherited from Sprite

gantt
#

Type Gantt

A reference to the parent Gantt chart.

ghostLabel
#

Type AxisLabel

Inherited from Axis

An invisible label that keeps room for the axis's widest label, so the axis doesn't shrink while zooming (see fixAxisSize).

Click here for more info

gridContainer
#

Type Container

Default Container.new(this._root,
{
  width: p100,
  height: p100
})

Inherited from Axis

Holds the axis's grid and fills, drawn below the series.

inited
#

Type boolean

Default false

Inherited from Component

Becomes true after the component's first update.

labelsContainer
#

Type Container

Default this.children.push(Container.new(this._root,
{
  
}))

Inherited from Axis

Holds the axis's labels and ticks.

minorDataItems
#

Type Array

Default []

Inherited from Axis

Data items of the minor grid.

parent
#

Type Container | undefined

Inherited from Sprite

Parent Container of this element.

root
#

Type Root

Inherited from Entity

The Root the object belongs to.

@readonly
@since 5.0.6

series
#

Type Array

Inherited from Axis

A list of series using this axis.

states
#

Type States

Default new States(this)

Inherited from Entity

template
#

Type Template | undefined

Inherited from Entity

A Template applied to the object. Its settings apply where the object has none set of its own.

topGridContainer
#

Type Container

Default Container.new(this._root,
{
  width: p100,
  height: p100
})

Inherited from Axis

Holds the grid and fills of axis ranges set to be drawn above the series.

uid
#

Type number

Default ++counter

Inherited from Settings

A unique number, given to each object as it is created.

virtualParent
#

Type Container | undefined

Inherited from Sprite

xButton
#

Type Button

Default this.children.push(Button.new(this._root,
{
  
themeTags: ["xbutton"],
  
icon: Graphics.new(this._root,
  {
    
themeTags: ["icon"]

  })

}))

The delete button shown on the selected task.

There are 24 inherited items currently hidden from this list.

Methods

allChildren()

#

Returns Array

Inherited from Container

Returns all children, including the background, vertical scrollbar and mask.

animate(

options: AnimationOptions

)

#

Returns Animation

Inherited from Settings

Animates a setting from its current value (or from) to to. The setting jumps to from at once. With duration 0, or no value to start from, it is set to to at once and the returned animation is already stopped.

Click here for more info

appear(

duration?: undefined | number,
delay?: undefined | number

)

#

Returns Promise

Inherited from Sprite

Plays the reveal animation: hides the element at once, then shows it, whether it was hidden or not.

axisPositionToIndex(

position: number

)

#

Returns number

Inherited from CategoryAxis

Returns the index of the category at a position on the axis.

categoryToIndex(

category: string

)

#

Returns number

Inherited from CategoryAxis

Returns an index of a category.

categoryToPosition(

category: string

)

#

Returns number

Inherited from CategoryAxis

Returns the position (0 to 1) of the middle of a category on the axis.

collapseAll()

#

Returns void

Collapses all tasks.

compositeOpacity()

#

Returns number

Inherited from Sprite

Returns the element's opacity multiplied by those of all its parents.

@since 5.2.11

compositeRotation()

#

Returns number

Inherited from Sprite

Returns the element's rotation plus those of all its parents, in degrees.

@since 5.9.2

compositeScale()

#

Returns number

Inherited from Sprite

Returns the element's scale multiplied by those of all its parents.

@since 5.9.2

contentHeight()

#

Returns number

Inherited from Container

contentWidth()

#

Returns number

Inherited from Container

coordinateToPosition(

coordinate: number

)

#

Returns number

Inherited from Axis

Converts a pixel coordinate along the axis, from its left or top edge, to a position on the axis (0 to 1), taking zoom into account.

createAxisRange(

axisDataItem: DataItem

)

#

Returns DataItem

Inherited from Axis

Adds a data item, made with axis.makeDataItem(), as an axis range and returns it.

Click here for more info

deleteAll()

#

Returns void

Deletes all tasks, from the axis and from the series.

deleteDataItem(

dataItem: DataItem,
child?: undefined | false | true

)

#

Returns void

Deletes a task with its subtasks, from the axis and from the series, after animating it out.

depth()

#

Returns number

Inherited from Sprite

Returns how deep the element is in the tree: the number of parents it has.

dispose()

#

Returns void

Inherited from Settings

Disposes the object, freeing everything it holds. A disposed object can't be used again.

disposeDataItem(

dataItem: DataItem

)

#

Returns void

Disposes a data item.

eachChildren(

f: ( child: Sprite) => void

)

#

Returns void

Inherited from Container

Calls f for each child, including the background, vertical scrollbar and mask.

endIndex()

#

Returns number

Inherited from CategoryAxis

Returns the index after the last category in view.

expandAll()

#

Returns void

Expands all tasks.

get(

key: Key,
fallback: F

)

#

Returns NonNullable | F

Inherited from Entity

Returns the value of setting key, run through any adapters, or fallback if it is not set.

Click here for more info

getCellWidthPosition()

#

Returns number

Inherited from CategoryAxis

Returns the distance between two grid lines as a share of the visible part of the axis.

@since 5.2.30

getDataItemById(

id: string

)

#

Returns DataItem | undefined

Inherited from Component

Returns the data item whose id matches, if any.

getDateFormatter()

#

Returns DateFormatter

Inherited from Sprite

Returns the DateFormatter of the element: its own dateFormatter, or else the one of the Root.

Click here for more info

getDurationFormatter()

#

Returns DurationFormatter

Inherited from Sprite

Returns the DurationFormatter of the element: its own durationFormatter, or else the one of the Root.

Click here for more info

getNumberFormatter()

#

Returns NumberFormatter

Inherited from Sprite

Returns the NumberFormatter of the element: its own numberFormatter, or else the one of the Root.

Click here for more info

getSeriesDataItem(

dataItem: DataItem

)

#

Returns DataItem | undefined

Returns the task's data item in the GanttSeries.

getSeriesItem(

series: XYSeries,
position: number

)

#

Returns DataItem | undefined

Inherited from CategoryAxis

Returns the series data item of the category at a position on the axis.

getTooltip()

#

Returns Tooltip | undefined

Inherited from Sprite

Returns the element's Tooltip: its own tooltip, or else the nearest parent's.

getTooltipText(

position: number,
_adjustPosition?: undefined | false | true

)

#

Returns string | undefined

Inherited from CategoryAxis

Returns the text the axis tooltip shows at a position: the axis's tooltipText, or else the text of the tooltip's or the category's label.

getX(

value: string

)

#

Returns number

Inherited from CategoryAxis

Returns the X coordinate in pixels of the middle of a category.

getY(

value: string

)

#

Returns number

Inherited from CategoryAxis

Returns the Y coordinate in pixels of the middle of a category.

has(

key: Key

)

#

Returns boolean

Inherited from Settings

Returns true if setting key is set.

Click here for more info

height()

#

Returns number

Inherited from Sprite

Returns the element's height in pixels.

hide(

duration?: undefined | number

)

#

Returns Promise

Inherited from Sprite

Hides the element and returns a Promise that resolves when its hiding animations finish.

series.hide().then(function(ev) {
  console.log("Series finished hiding");
})
series.hide().then(function(ev) {
  console.log("Series finished hiding");
})

hideDataItem(

dataItem: DataItem

)

#

Returns Promise

Hides a task's row.

hideTooltip()

#

Returns Promise | undefined

Inherited from Sprite

Hides the element's Tooltip.

hover()

#

Returns void

Inherited from Sprite

Hovers the element as if the pointer were over it: applies its hover state and shows its tooltip.

indexToPosition(

index: number,
location?: undefined | number,
final?: undefined | false | true

)

#

Returns number

Inherited from CategoryAxis

Converts a category index to a position on the axis (0 to 1).

innerHeight()

#

Returns number

Inherited from Container

Returns the container's height without padding, in pixels.

innerWidth()

#

Returns number

Inherited from Container

Returns the container's width without padding, in pixels.

isDisposed()

#

Returns boolean

Inherited from Settings

Returns true if the object has been disposed.

isDragging()

#

Returns boolean

Inherited from Sprite

Returns true while the element is being dragged.

isFocus()

#

Returns boolean

Inherited from Sprite

Returns true if this element does currently have focus.

isHidden()

#

Returns boolean

Inherited from Sprite

Returns true if the element was hidden with hide(), even while its hiding animation still plays. For the visible setting, use isVisible().

isHiding()

#

Returns boolean

Inherited from Sprite

Returns true while the element's hiding animation plays.

isHover()

#

Returns boolean

Inherited from Sprite

Returns true if the pointer is over the element.

isShowing()

#

Returns boolean

Inherited from Sprite

Returns true while the element's showing animation plays.

isType(

type: string

)

#

Returns this

Inherited from Entity

Returns true if the object is of class type or extends it.

isVisible()

#

Returns boolean

Inherited from Sprite

Returns false if either the public or the private setting visible is false, or forceHidden is true.

isVisibleDeep()

#

Returns boolean

Inherited from Sprite

Same as isVisible(), except it checks all ascendants, too.

@since 5.2.7

makeDataItem(

data: IGanttCategoryAxisDataItem,
dataContext?: any

)

#

Returns DataItem

Inherited from Component

Creates and processes a data item, without adding it to dataItems.

markDirtyKey(

key: Key

)

#

Returns void

Inherited from Sprite

Marks a setting as changed, so the element reads it again, running its adapters, on the next frame.

markDirtyTree()

#

Returns void

markDirtyValues(

_dataItem?: DataItem

)

#

Returns void

Inherited from Component

Makes the component redraw from its data on the next frame.

@since 5.0.21

maxHeight()

#

Returns number

Inherited from Sprite

Returns the most height the element may take, in pixels: its maxHeight, a fixed height, or else its parent's inner height.

maxWidth()

#

Returns number

Inherited from Sprite

Returns the most width the element may take, in pixels: its maxWidth, a fixed width, or else its parent's inner width.

new(

root: Root,
settings: ITSettings,
template?: Template

)

#

Static

Returns T

Inherited from Entity

Creates an instance of the class. Use it instead of new Class().

Click here for more info

off(

key: Key,
callback?: undefined | ( value: [""], target: this, key: Key) => void

)

#

Returns void

Inherited from Settings

Removes a callback added with on(). Without callback, removes all of them for key.

Click here for more info
@since 5.9.2

offDebounced(

key: Key,
callback?: undefined | ( value: [""], target: this, key: Key) => void

)

#

Returns void

Inherited from Settings

Removes a callback added with onDebounced(). Without callback, removes all of them for key.

Click here for more info

offDebouncedPrivate(

key: Key,
callback?: undefined | ( value: [""], target: this, key: Key) => void

)

#

Returns void

Inherited from Settings

Removes a callback added with onPrivateDebounced(). Without callback, removes all of them for key.

Click here for more info

offPrivate(

key: Key,
callback?: undefined | ( value: [""], target: this, key: Key) => void

)

#

Returns void

Inherited from Settings

Removes a callback added with onPrivate(). Without callback, removes all of them for key.

Click here for more info
@since 5.9.2

on(

key: Key,
callback: ( value: [""], target: this, key: Key) => void

)

#

Returns IDisposer

Inherited from Settings

Calls callback each time the value of setting key changes or is removed. Setting the same value again does not call it.

Click here for more info

onDebounced(

key: Key,
callback: ( value: [""], target: this, key: Key) => void,
debounceDelay: number

)

#

Returns IDisposer

Inherited from Settings

Like on(), but waits until setting key has not changed for debounceDelay milliseconds, then calls callback once with the latest value.

Click here for more info

onPrivate(

key: Key,
callback: ( value: [""], target: this, key: Key) => void

)

#

Returns IDisposer

Inherited from Settings

Calls callback each time the value of private setting key changes.

Click here for more info

onPrivateDebounced(

key: Key,
callback: ( value: [""], target: this, key: Key) => void,
debounceDelay: number

)

#

Returns IDisposer

Inherited from Settings

Like onPrivate(), but waits until private setting key has not changed for debounceDelay milliseconds, then calls callback once with the latest value.

Click here for more info

once(

key: Key,
callback: ( value: [""], target: this, key: Key) => void

)

#

Returns IDisposer

Inherited from Settings

Like on(), but the callback is removed after it is called once.

Click here for more info
@since 5.20.4

onceDebounced(

key: Key,
callback: ( value: [""], target: this, key: Key) => void,
debounceDelay: number

)

#

Returns IDisposer

Inherited from Settings

Like onDebounced(), but the callback is removed after it is called once.

Click here for more info
@since 5.20.4

pushDataItem(

data: IGanttCategoryAxisDataItem,
dataContext?: any

)

#

Returns DataItem

Inherited from Component

Creates a data item straight from settings, not from data, and adds it to the component's data items.

remove(

key: Key

)

#

Returns void

Inherited from Entity

Removes the value set for setting key. The setting goes back to the value from a theme or template, if one has it.

Click here for more info

removeAll()

#

Returns void

Inherited from Settings

Removes all settings, as remove() does for each one.

Click here for more info

scrollToChild(

child: Sprite

)

#

Returns void

Inherited from Container

Scrolls the container so that the child comes into view, if it is out of view. Works only on a container with a verticalScrollbar.

@since 5.10.5

selectDataItem(

dataItem?: DataItem

)

#

Returns void

Selects a task and shows its delete button; an already selected task is unselected. Does nothing while the Gantt is not editable.

set(

key: Key,
value: Value

)

#

Returns Value

Inherited from Entity

Sets setting key to value and returns value. A value set this way overrides themes and templates, and stops any animation of the setting.

Click here for more info

setAll(

settings: Partial

)

#

Returns void

Inherited from Settings

Sets several settings at once, from an object of key-value pairs.

Click here for more info

setDataItemColor(

dataItem?: DataItem,
c?: Color

)

#

Returns void

Sets the customColor of a task and its subtasks. A color equal to the task's own color, or none, clears it.

setTimeout(

fn: () => void,
delay: number

)

#

Returns IDisposer

Inherited from Entity

Calls fn after delay milliseconds, unless the object is disposed first. Disposing the returned disposer cancels it.

show(

duration?: undefined | number

)

#

Returns Promise

Inherited from Sprite

Shows the element and returns a Promise that resolves when its showing animations finish.

series.show().then(function(ev) {
  console.log("Series is now fully visible");
})
series.show().then(function(ev) {
  console.log("Series is now fully visible");
})

showDataItem(

dataItem: DataItem

)

#

Returns Promise

Shows a task's row.

showTooltip(

point?: IPoint

)

#

Returns Promise | undefined

Inherited from Sprite

Shows the element's Tooltip. Does nothing if the element has no tooltipText or tooltipHTML.

startIndex()

#

Returns number

Inherited from CategoryAxis

Returns the index of the first category in view.

toAxisPosition(

position: number

)

#

Returns number

Inherited from Axis

Converts a position in the plot area (0 to 1, from its left or top edge) to a position on the axis, taking zoom and inversed into account.

toBack()

#

Returns void

Inherited from Sprite

Moves the element to the start of its parent's children, so it is drawn under its siblings, or, in a layout, placed first.

toFront()

#

Returns void

Inherited from Sprite

Moves the element to the end of its parent's children, so it is drawn over its siblings, or, in a layout, placed last.

toGlobal(

point: IPoint

)

#

Returns IPoint

Inherited from Sprite

Converts a point within the element to a point relative to the root.

toGlobalPosition(

position: number

)

#

Returns number

Inherited from Axis

Converts a position on the axis to a position in the plot area (0 to 1, from its left or top edge): the opposite of toAxisPosition.

@since 5.4.2

toLocal(

point: IPoint

)

#

Returns IPoint

Inherited from Sprite

Converts a point relative to the root to a point within the element.

toggleCollapse(

dataItem: DataItem,
collapse?: undefined | false | true,
duration?: undefined | number

)

#

Returns void

Collapses or expands a task's subtasks, at all levels below it.

toggleProgressPie(

dataItem?: DataItem,
value?: undefined | number

)

#

Returns void

Toggles a task between done and its previous progress, as a click on its progress pie does: progress below 1 animates to 1, and 1 back to the previous value. For a task with subtasks, it toggles them all.

unhover()

#

Returns void

Inherited from Sprite

Ends a hover, as if the pointer left the element: hides its tooltip and takes it out of its hover state.

unselectDataItems()

#

Returns void

Unselects the selected task and hides the delete button.

updateData(

data: Array

)

#

Returns void

Inherited from Component

Updates the data in place, keeping the existing data items: each object's values go into the data item at the same index. Extra objects are added as new data items, and data items beyond the new data are removed.

updateTooltip()

#

Returns void

Inherited from Axis

Moves the axis tooltip, and the series tooltips it drives, to the cursor's current position. Call it after changing the zoom from code.

width()

#

Returns number

Inherited from Sprite

Returns the element's width in pixels.

x()

#

Returns number

Inherited from Sprite

Returns the element's X position in pixels, relative to its parent, without dx.

y()

#

Returns number

Inherited from Sprite

Returns the element's Y position in pixels, relative to its parent, without dy.

zoom(

start: number,
end: number,
duration?: undefined | number

)

#

Returns Animation | Animation | undefined

Zooms the axis to a range given as positions from 0 (start of the axis) to 1 (end).

zoomToCategories(

startCategory: string,
endCategory: string,
duration?: undefined | number

)

#

Returns void

Inherited from CategoryAxis

Zooms the axis to show the categories from startCategory to endCategory, both included.

zoomToIndexes(

start: number,
end: number,
duration?: undefined | number

)

#

Returns void

Inherited from CategoryAxis

Zooms the axis to show the categories from index start up to, but not including, end.

There are 86 inherited items currently hidden from this list.

Events

Add event handlers to GanttCategoryAxis object using its events.on() method.

Read about adding event handlers.

#blur

Param { originalEvent: FocusEvent,
  target: Sprite,
  type: "blur",
  target: this }

Inherited from ISpriteEvents

Invoked when element loses focus.

#boundschanged

Param { type: "boundschanged",
  target: this }

Inherited from ISpriteEvents

The element's bounds changed.

#click

Param { type: "click",
  target: this }

Inherited from ISpriteEvents

The element was clicked or tapped. A press and release more than 5 pixels apart is not a click.

#dataitemchanged

Param { newDataItem: DataItem | undefined,
  oldDataItem: DataItem | undefined,
  type: "dataitemchanged",
  target: this }

Inherited from ISpriteEvents

The element's data item changed.

#datavalidated

Param { type: "datavalidated",
  target: this }

Inherited from IComponentEvents

The component's data changed and was processed.

#dblclick

Param { type: "dblclick",
  target: this }

Inherited from ISpriteEvents

The element was double-clicked or double-tapped. Also dispatched on its parents.

#dragged

Param { type: "dragged",
  target: this }

Inherited from ISpriteEvents

The element moved while being dragged.

#dragstart

Param { type: "dragstart",
  target: this }

Inherited from ISpriteEvents

Dragging of the element started: the pointer moved more than 5 pixels after pressing on it.

#dragstop

Param { type: "dragstop",
  target: this }

Inherited from ISpriteEvents

Dragging of the element stopped.

#focus

Param { originalEvent: FocusEvent,
  target: Sprite,
  type: "focus",
  target: this }

Inherited from ISpriteEvents

Invoked when element gains focus.

#globalpointerdown

Param { type: "globalpointerdown",
  target: this }

Inherited from ISpriteEvents

A pointer button was pressed, or a touch started, anywhere in the window, even outside the chart.

#globalpointermove

Param { type: "globalpointermove",
  target: this }

Inherited from ISpriteEvents

The pointer moved anywhere in the window, even outside the chart.

#globalpointerup

Param { type: "globalpointerup",
  target: this }

Inherited from ISpriteEvents

A pointer button was released, or a touch ended, anywhere in the window, even outside the chart.

#middleclick

Param { type: "middleclick",
  target: this }

Inherited from ISpriteEvents

The element was clicked with the middle mouse button.

#pointerdown

Param { type: "pointerdown",
  target: this }

Inherited from ISpriteEvents

A pointer button was pressed, or a touch started, over the element. Also dispatched on its parents.

#pointerout

Param { type: "pointerout",
  target: this }

Inherited from ISpriteEvents

The pointer left the element.

#pointerover

Param { type: "pointerover",
  target: this }

Inherited from ISpriteEvents

The pointer moved over the element.

#pointerup

Param { type: "pointerup",
  target: this }

Inherited from ISpriteEvents

A pointer button was released, or a touch ended, over the element.

#positionchanged

Param { type: "positionchanged",
  target: this }

Inherited from ISpriteEvents

The element's position changed.

#rightclick

Param { type: "rightclick",
  target: this }

Inherited from ISpriteEvents

The element was clicked with the right mouse button.

#valueschanged

Param { type: "valueschanged",
  target: this }

Inherited from IComponentEvents

Values of the component's data items changed.

#wheel

Param { originalEvent: WheelEvent,
  point: IPoint,
  type: "wheel",
  target: this }

Inherited from ISpriteEvents

The mouse wheel turned while the pointer was over the element. Also dispatched on its parents.

There are 22 inherited items currently hidden from this list.