angular-gantt
Version:
Gantt chart component for AngularJS
71 lines (47 loc) • 1.86 kB
Markdown
for column headers in the corner
angular.module('myApp', ['gantt', 'gantt.corner']);
<!-- -->
<div gantt>
<gantt-corner enabled="..." headers-labels="..."></gantt-corner>
</div>
<!-- -->
<link rel="stylesheet" href="angular-gantt-corner.css">
-
Enable corner display.
default: `true`
-
Associative object of headers labels. Key is the header, and value is the label.
$scope.headersLabels = {
year: 'Year',
quarter: 'Quarter',
month: 'Month',
week: 'Week',
day: 'Day',
hour: 'Hour',
minute:'Minute'
};
It is also possible to specify a function to return the header label.
$scope.headersLabels = function(headerName, headerUnit, columns) {
// Capitalize the header name to build the label.
return headerName.charAt(0).toUpperCase() + headerName.slice(1);
}
-
The template to use to display a single header label.
default: `{{getLabel(header)}}`
Can also be an associative object, where Key is the header, and value is the template.
$scope.headersLabels = {
year: '<i>{{getLabel(header)}}</i>',
month: '<b>{{getLabel(header)}}</b>',
};
It is also possible to specify a function to return the header label template.
$scope.headersLabelsTemplates = function(headerName, headerUnit, columns) {
if (headerName == 'year') {
return '<i>{{getLabel(header)}}</i>';
} else if (headerName == 'month') {
return '<b>{{getLabel(header)}}</b>';
}
// Other case will default template.
}
Display labels