Baselines

Displays a task's baselines below the tasks in the timeline.

Baselines
//<code-header>
fiddle.title = 'Baselines';
//</code-header>
// Project contains all the data and is responsible for correct scheduling
const project = new ProjectModel({
    startDate : new Date(2017, 0, 1),

    tasks : [
        {
            id       : 1,
            name     : 'Write docs',
            expanded : true,
            children : [
                {
                    id        : 2,
                    name      : 'Proof-read docs',
                    startDate : '2017-01-02',
                    endDate   : '2017-01-05',
                    baselines : [{
                        startDate : '2017-01-01',
                        endDate   : '2017-01-04'
                    }]
                },
                {
                    id        : 3,
                    name      : 'Release docs',
                    startDate : '2017-01-09',
                    endDate   : '2017-01-10',
                    baselines : [{
                        startDate : '2017-01-04',
                        endDate   : '2017-01-09'
                    }]
                }
            ]
        }
    ],

    dependencies : [
        { fromTask : 2, toTask : 3 }
    ]
});

const gantt = new Gantt({
    features : {
        baselines : true
    },
    appendTo  : targetElement,
    project, // Gantt needs project to get schedule data from
    startDate : new Date(2016, 11, 31),
    endDate   : new Date(2017, 0, 11),
    height    : 250,
    columns   : [
        { type : 'name', field : 'name', text : 'Name' }
    ]
});

This feature also optionally shows a tooltip when hovering any of the task's baseline elements. The tooltip's content may be customized.

If dates (startDate and endDate) are left out in the baseline data, the task's dates will be applied. If dates are null, they will be kept empty and the baseline bar won't be displayed in the UI.

To customize the look of baselines, you can supply cls or style in the baseline data.

This feature is disabled by default. For info on enabling it, see GridFeatures.

Configs

14

Common

disabledInstancePlugin
listenersEvents

Other

An empty function by default, but provided so that you can override it. This function is called each time a task baseline is rendered into the gantt to render the contents of the baseline element.

Returning a string will display it in the baseline bar, it accepts both plain text or HTML. It is also possible to return a DOM config object which will be synced to the baseline bars content.

// using plain string
new Gantt({
    features : {
        baselines : {
            renderer : ({ baselineRecord }) => baselineRecord.startDate
        }
    }
});

// using DOM config
new Gantt({
    features : {
        baselines : {
            renderer : ({ baselineRecord }) => {
                return {
                    tag : 'b',
                    html : baselineRecord.startDate
                };
            }
        }
    }
});
ParameterTypeDescription
detailObject

An object containing the information needed to render a Baseline.

detail.taskRecordTaskModel

The task record.

detail.baselineRecordBaseline

The baseline record.

detail.renderDataDomConfig

An object containing details about the baseline element.

Returns: DomConfig | DomConfig[] | String -

A string or an DomObject config object to append to a baseline element children

template: function

Template (a function accepting event data and returning a string) used to display info in the tooltip. The template will be called with an object as with fields as detailed below

ParameterTypeDescription
dataObject

A data block containing the information needed to create tooltip content

data.baselineBaseline

The Baseline record to display

data.startClockHtmlString

Predefined HTML to show the start time

data.endClockHtmlString

Predefined HTML to show the end time

Returns: DomConfig | String | null
hideDelayTooltipBase
hoverDelayTooltipBase

Misc

autoUpdateTooltipBase
clientInstancePlugin
localeClassLocalizable
localizableLocalizable

Properties

18

Common

disabledInstancePlugin

Class hierarchy

isBaselines: Boolean= truereadonly
Identifies an object as an instance of Baselines class, or subclass thereof.
isBaselines: Boolean= truereadonlystatic
Identifies an object as an instance of Baselines class, or subclass thereof.
isEventsEvents
isInstancePluginInstancePlugin
isLocalizableLocalizable
isTooltipBaseTooltipBase

Other

An empty function by default, but provided so that you can override it. This function is called each time a task baseline is rendered into the gantt to render the contents of the baseline element.

Returning a string will display it in the baseline bar, it accepts both plain text or HTML. It is also possible to return a DOM config object which will be synced to the baseline bars content.

// using plain string
new Gantt({
    features : {
        baselines : {
            renderer : ({ baselineRecord }) => baselineRecord.startDate
        }
    }
});

// using DOM config
new Gantt({
    features : {
        baselines : {
            renderer : ({ baselineRecord }) => {
                return {
                    tag : 'b',
                    html : baselineRecord.startDate
                };
            }
        }
    }
});
ParameterTypeDescription
detailObject

An object containing the information needed to render a Baseline.

detail.taskRecordTaskModel

The task record.

detail.baselineRecordBaseline

The baseline record.

detail.renderDataDomConfig

An object containing details about the baseline element.

Returns: DomConfig | DomConfig[] | String -

A string or an DomObject config object to append to a baseline element children

Lifecycle

configBase

Misc

clientInstancePlugin
localeHelperLocalizable
localeManagerLocalizable
tooltipTooltipBase

Functions

28

Configuration

applyDefaultsstaticBase

Events

Lifecycle

destroystaticBase

Misc

doDisableInstancePlugin
initClassstaticBase
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

Other

LstaticLocalizable
onEvents
relayAllEvents
triggerEvents
unEvents

Events

7
beforeShowTooltipBase
catchAllEvents
destroyEvents
disableInstancePlugin
enableInstancePlugin
showTooltipBase

Event handlers

7
onBeforeShowTooltipBase
onDestroyEvents
onDisableInstancePlugin
onEnableInstancePlugin
onShowTooltipBase

Typedefs

1

CSS variables

7
NameDescription
--b-baseline-wrap-sizeBaseline wrap size, as a fraction of the event size. This is the height of the baseline wrap, shared by all baselines
--b-baseline-border-widthBaseline border width
--b-baseline-border-colorBaseline border color
--b-baseline-margin-topBaseline margin top
--b-baseline-transition-durationBaseline transition duration
--b-baseline-flexBaseline flex
--b-baseline-border-radiusBaseline border radius