onScaleAdjusted

当比例尺重新渲染以确保所有任务完全可见时触发

void onScaleAdjusted();

Example

gantt.attachEvent("onScaleAdjusted", function(){
    const min = gantt.getState().min_date;
    const max = gantt.getState().max_date;
    const to_str = gantt.templates.task_date;
 
    return gantt.message(`Scale shows days from ${to_str(min)} 
 to ${to_str(max)}`);
});

Related samples

Details

请注意,只有在启用 fit_tasks 属性(设置为 true)时,此事件才会触发。

See also
Back to top