GanttDataProvider
Data source for the timeline chart
Configs
6
Configs
6Common
Data
Default dataset to show.
Other
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);
}
}
}
}
}
}
});
Properties
11
Properties
11Class hierarchy
Misc
Functions
25
Functions
25Other
Returns dataset for the chart
| Parameter | Type | Description |
|---|---|---|
viewConfig | TimelineChartViewConfig | |
datasets | String[] | List of dataset names to return |
Configuration
Events
Events
4
Events
4Event handlers
4
Event handlers
4Typedefs
7
Typedefs
7| Parameter | Type | Description |
|---|---|---|
task | TaskModel | The task to calculate the value for |
start | Date | The start date of the interval |
end | Date | The end date of the interval |
durationDoneToDate | Number | Total working time expired before the start of the current interval |
durationDone | Number | Working time actually spent on the task - duration * percentDone |
durationInInterval | Number | Task working time in the given interval |
| Parameter | Type | Description |
|---|---|---|
text | String | The text to display in the legend |
total | Number | The total value of the series |
color | String | Any valid CSS color value: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value |
callback | GanttDataProviderSeriesCallback | The function to calculate the value of the series |