[]
Sheets.GanttSheet.TaskbarStyleRule
• new TaskbarStyleRule()
Creates a task bar style rule with the specified name.
classdesc
Represents a task bar style rule for project. Could extend from this class and implement a customized rule.
example
class MyProgressRule extends TaskbarStyleRule {
constructor() {
super("My Progress");
this.style = {
taskbarStyle: {
middleColor: "#3B87D4",
middleShape: "RectangleMiddle",
middlePattern: "solidFill",
}
};
}
match(task: Task): boolean {
return task.complete > 0;
}
getFromDate(task: Task) {
return task.startDisplayed;
}
getToDate(task: Task) {
return task.completeThrough;
}
}
• name: string
Gets the name of this rule.
• style: TaskStyle
Gets or sets the style for all task bars this rule matched.
▸ getFromDate(task
): Date
Gets the date that indicates the start of the task bar for the specified task. By default it returns task.startDisplayed. Override this method in your customized rule and returns the result.
Name | Type | Description |
---|---|---|
task |
Task |
A matched task for this rule. |
Date
A date value indicates the start of the task bar for the specified task.
▸ getToDate(task
): Date
Gets the date that indicates the end of the task bar for the specified task. By default it returns task.finishDisplayed. Override this method in your customized rule and returns the result.
Name | Type | Description |
---|---|---|
task |
Task |
A matched task for this rule. |
Date
A date value indicates the end of the task bar for the specified task.
▸ match(task
): boolean
Determines the task bar defined by this rule matches the specified task or not. Override this method in your customized rule and returns the result.
abstract
Name | Type | Description |
---|---|---|
task |
Task |
The task to check. |
boolean
true if the task is matched and will show the task bar of this rule; otherwise false.