[]
        
(Showing Draft Content)

GC.Spread.Sheets.GanttSheet.TaskbarStyleRule

Class: TaskbarStyleRule

Sheets.GanttSheet.TaskbarStyleRule

Table of contents

Constructors

Properties

Methods

Constructors

constructor

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;
     }
 }

Properties

name

name: string

Gets the name of this rule.


style

style: TaskStyle

Gets or sets the style for all task bars this rule matched.

Methods

getFromDate

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.

Parameters

Name Type Description
task Task A matched task for this rule.

Returns

Date

A date value indicates the start of the task bar for the specified task.


getToDate

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.

Parameters

Name Type Description
task Task A matched task for this rule.

Returns

Date

A date value indicates the end of the task bar for the specified task.


match

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

Parameters

Name Type Description
task Task The task to check.

Returns

boolean

true if the task is matched and will show the task bar of this rule; otherwise false.