histogram_cell_label
信息
此功能仅在 PRO 版本中可用。
Description
定义显示在单元格内的标签
histogram_cell_label: (start_date: Date, end_date: Date, resource: any, tasks: Array<Task>, assignments: any[]) => string | number | void;
Parameters
start_date- (required) Date - 刻度单元格的起始日期end_date- (required) Date - 刻度单元格的结束日期resource- (required) object - 与单元格关联的资源对象tasks- (required) Array - <Task> 分配给指定资源且与单元格起止日期重叠的任务列表assignments- (required) array - 与指定任务起止日期相关联的资源分配
Returns
label- (string | number | void) - 用作直方图单元格内标签的HTML字符串或数字
Example
gantt.templates.histogram_cell_label = function(start_date,end_date,resource,tasks,
assignments){
return tasks.length * 8;
};
Related samples
Details
注释
仅当启用 process_resource_assignments 配置时,才会提供 "assignments" 参数。
Related API
- histogram_cell_class
- histogram_cell_allocated
- histogram_cell_capacity
- process_resource_assignments
- resource_property
Related Guides
Change log
- 在版本7.1中引入了 assignments 参数
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.