跳到主要内容

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

Details

注释

仅当启用 process_resource_assignments 配置时,才会提供 "assignments" 参数。

Change log

  • 在版本7.1中引入了 assignments 参数