GanttDataProvider

Data source for the timeline chart

Configs

6

Common

listenersEvents

Data

defaultDataset: duration | progress | String= duration

Default dataset to show.

Other

meta: Object= {"duration":"","progress":""}

This object configures available data series, metadata and a function to calculate the values. Every key is a dataset name, and every value is an SeriesMetaData object with the following properties:

  • text - the text to display in the legend
  • total - the total value of the series
  • color - the color of the series
  • callback - the function to calculate the value of the series
// Metadata object example
duration : {
    text : 'Duration',
    total : 0,
    color : '#CC0033',
    callback : this.prototype.getTaskDuration
}

Color

Color is an optional parameter. If not provided, the default color will be used. Series color can be styles with CSS using attribute selector:

.b-timeline-overlay-chart path[data-series="name"] { stroke: #FF0000; }
.b-timeline-overlay-chart circle[data-series="name"] { fill: #FF0000; }

Callback

Callback is used to generate series data. It is called for every leaf task for every interval, specified by unit, between project start and end dates. For example, to calculate working time of the task in the given period:

new Gantt({
  features : {
    timelineChart : {
      dataProvider : {
        meta : {
          duration : {
            callback : (task, start, end) {
              // default implementation
              return task.effectiveCalendar.calculateDurationMs(start, end);
            }
          }
        }
      }
    }
  }
});

Misc

Properties

11

Class hierarchy

isGanttDataProvider: Boolean= truereadonly
Identifies an object as an instance of GanttDataProvider class, or subclass thereof.
isGanttDataProvider: Boolean= truereadonlystatic
Identifies an object as an instance of GanttDataProvider class, or subclass thereof.
isEventsEvents
isTimelineChartDataProviderBaseTimelineChartDataProviderBase

Lifecycle

configBase

Misc

Other

datasetsTimelineChartDataProviderBase

Functions

25

Other

Returns dataset for the chart

ParameterTypeDescription
viewConfigTimelineChartViewConfig
datasetsString[]

List of dataset names to return

onEvents
relayAllEvents
triggerEvents
unEvents

Configuration

applyDefaultsstaticBase

Events

Lifecycle

destroystaticBase

Misc

initClassstaticBase
isOfTypeNamestaticBase
mixinstaticBase

Events

4
catchAllEvents
destroyEvents
refreshTimelineChartDataProviderBase

Event handlers

4
onDestroyEvents
onRefreshTimelineChartDataProviderBase

Typedefs

7
ParameterTypeDescription
taskTaskModel

The task to calculate the value for

startDate

The start date of the interval

endDate

The end date of the interval

durationDoneToDateNumber

Total working time expired before the start of the current interval

durationDoneNumber

Working time actually spent on the task - duration * percentDone

durationInIntervalNumber

Task working time in the given interval

ParameterTypeDescription
textString

The text to display in the legend

totalNumber

The total value of the series

colorString

Any valid CSS color value: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value

callbackGanttDataProviderSeriesCallback

The function to calculate the value of the series

DatasetMetaDataTimelineChartDataProviderBase
TimelineChartDatasetTimelineChartDataProviderBase
TimelineChartLineDataTimelineChartDataProviderBase
TimelineChartViewConfigTimelineChartDataProviderBase