Skip to main content

The Timeline web component

Display a Gantt chart of events.

For more information about this component, refer to the Timeline guide.

Properties

All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.

data

The data.

Type array
Format Custom data
Mutability
ControlUsage
Retool UI Inspector
MethodcopyToClipboard()

eventColorByIndex

A list of colors for each item, by index.

Type array
Array values string
Mutability Read-only

eventEndDateByIndex

A list of event end dates, by index.

Type array
Array values string
Mutability Read-only

eventIdByIndex

A list of event IDs, by index.

Type array
Array values string
Mutability Read-only

eventPropertiesByIndex

A list of event properties, by index.

Type array
Array values string
Mutability Read-only

eventStartDateByIndex

A list of event start dates, by index.

Type array
Array values string
Mutability Read-only

eventTitleByIndex

A list of event titles, by index.

Type array
Array values string
Mutability Read-only

eventTooltipLabelByIndex

A list of tooltips for each item, by index.

Type array
Array values string
Mutability Read-only
Default
[]
Examples
["Tooltip 1", "Tooltip 2"]

groupBy

The grouping option when isGrouped is true.

Type string
Mutability Read-only
Allowed Values
ValueDescription
day

Group items by day.

none

Disable grouping.


hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance
MethodsetHidden()
Default
false
Examples
true

id

The unique identifier (name).

Type string
Format Plain Text
Mutability
ControlUsage
Retool UI Inspector
Default
timeline1
Examples
query1
button1

initialDate

The initial date to display.

Type string
Mutability
ControlUsage
Retool UI Inspector

metaEventColorByIndex

A list of meta event colors, by index.

Type array
Array values string
Mutability Read-only

metaEventData

The metadata for the event.

Type object
Mutability
ControlUsage
Retool UI Inspector

metaEventEndDateByIndex

A list of meta event end dates, by index.

Type array
Array values string
Mutability Read-only

metaEventStartDateByIndex

A list of meta event start dates, by index.

Type array
Array values string
Mutability Read-only

metaEventTitleByIndex

A list of meta event titles, by index.

Type array
Array values string
Mutability Read-only

milestoneColorByIndex

A list of milestone colors, by index.

Type array
Array values string
Mutability Read-only

milestoneData

The data.

Type array
Format Custom data
Mutability
ControlUsage
Retool UI Inspector

milestoneDateByIndex

A list of milestone dates, by index.

Type array
Array values string
Mutability Read-only

milestoneTitleByIndex

A list of milestone titles, by index.

Type array
Array values string
Mutability Read-only

quarterStartDay

The day of the month when Q1 starts.

Type number
Mutability Read-only

quarterStartMonth

The month when Q1 starts.

Type number
Mutability Read-only

renderOneEventPerRow

Whether to render one event per row.

Type boolean
Mutability Read-only

showTodayIndicator

Whether to show the current date indicator.

Type boolean
Mutability Read-only

style

Custom style options.

Type object
Mutability
ControlUsage
Retool UI Inspector > Appearance

timescale

The visible period of time to render.

Type object
Mutability
ControlUsage
Retool UI Inspector
Object Properties

split

The unit of time with which to split.

Type string
Mutability Read-only
Allowed Values
ValueDescription
week

Week

month

Month

day

Day


unit

The unit of time with which to render.

Type string
Mutability Read-only
Allowed Values
ValueDescription
week

Week

month

Month

quarter

Quarter

year

Year



Methods

JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.

timeline.scrollIntoView()

Scrolls the canvas or parent container so that the selected component appears in the visible area.

Definition
timeline.scrollIntoView(options)
Parameters

options Required

object

The scroll options.

Object Properties

behavior Required

string

The scroll behavior.

Supported Values
auto

Scroll immediately to the specified position.

smooth

Scroll gradually to the specified position.

block Required

string

The scroll position relative to the component.

Supported Values
nearest

Scrolls only the minimum amount required for the component to appear in the visible area. Scrolling does not occur if the component is already in view.

start

Scrolls to position the component at the top of the visible area.

center

Scrolls to position the component in the middle of the visible area.

end

Scrolls to position the component at the bottom of the visible area.

Examples

Scroll the minimum amount to immediately bring timeline into view.

timeline.scrollIntoView({behavior: 'auto', block: 'nearest'});

timeline.setHidden()

Set the hidden value to toggle whether the component is visible. Defaults to true without a parameter.

Definition
timeline.setHidden(hidden)
Parameters

hidden

boolean

Whether this object is hidden from view.

Examples

Hide timeline.

timeline.setHidden(true);

Unhide timeline.

timeline.setHidden(false);

Events

Events triggered by user interactions. Use event handlers to trigger queries or other actions in response to events.

click

An item is clicked or pressed.