histogram_cell_allocated
信息
此功能仅在 PRO 版本中可用。
Description
指定 resourceHistogram 中填充部分的高度
histogram_cell_allocated: (start_date: Date, end_date: Date, resource: any, tasks: Array<Task>, assignments: any[]) => number | void;
Parameters
start_date- (required) Date - 时间刻度单元的开始日期end_date- (required) Date - 时间刻度单元的结束日期resource- (required) object - 资源对象tasks- (required) Array - <Task> 分配给指定资源且与单元的开始/结束日期重叠的任务列表assignments- (required) array - 与任务指定的开始/结束日期相关联的资源分配
Returns
height- (number | void) - resourceHistogram 中填充部分的高度
Example
gantt.templates.histogram_cell_allocated=function(start_date,end_date,resource,tasks,
assignments){
return tasks.length * 8;
};
Related samples
Details
注释
仅当启用 process_resource_assignments 配置时,才能访问 "assignments" 参数。
模板的返回值范围为 0 到 maxCapacity。
maxCapacity 说明
如果将每个 histogram 行视为条形图,maxCapacity 表示该图表 Y 轴的高度。在下面的示例图片中,maxCapacity 等于 24:
Related API
- histogram_cell_class
- histogram_cell_label
- histogram_cell_capacity
- process_resource_assignments
- resource_property
Related Guides
Change log
- assignments 参数在 v7.1 中引入
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.