Popular features/Effort-driven planning
Loading live demo…from dhtmlxcode.com
Popular features
Effort-driven planning
Assign people to tasks and watch the duration or the work recalculate under the Fixed work, Fixed duration, and Fixed units scheduling modes.
gantt.plugins({ auto_scheduling: true, toolbar: true, context_menu: true, task_form: true, marker: true });
const PROJECT_ID = 1;
const MOVE_IN_ID = 90;
const DEADLINE = "2027-04-02";
const people = [
{ id: 1, text: "Ava Reed", role: "Painter", color: "#2563eb", capacity: 8 },
{ id: 2, text: "Leo Marsh", role: "Painter", color: "#0891b2", capacity: 8 },
{ id: 3, text: "Mia Fontana", role: "Electrician", color: "#059669", capacity: 8 },
{ id: 4, text: "Noah Kim", role: "Carpenter", color: "#d97706", capacity: 8 },
{ id: 5, text: "Zoe Hart", role: "Carpenter, part-time", color: "#db2777", capacity: 4 },
{ id: 6, text: "Sam Ortiz", role: "Site lead", color: "#64748b", capacity: 8 }
];
// each mode keeps one value of Work = Days × Hours per day when the other two change
const modes = [
{ key: "fixed_work", label: "Fixed work", keeps: "work", rule: "more people, shorter task" },
{ key: "fixed_duration", label: "Fixed duration", keeps: "duration", rule: "more people, more work" },
{ key: "fixed_units", label: "Fixed units", keeps: "units", rule: "more work, longer task" }
];
const modeOf = task => modes.find(mode => mode.key === task.scheduling_mode);
function getPlan() {
return {
resources: people.map(person => ({ ...person })),
tasks: [
{ id: PROJECT_ID, text: "Office fit-out", type: "project", open: true },
{ id: 10, parent: PROJECT_ID, text: "Strip-out", start_date: "2027-03-01", duration: 4, scheduling_mode: "fixed_work", owner: [{ resource_id: 4, value: 8 }] },
{ id: 20, parent: PROJECT_ID, text: "Electrical wiring", start_date: "2027-03-05", duration: 4, scheduling_mode: "fixed_units", owner: [{ resource_id: 3, value: 8 }] },
{ id: 30, parent: PROJECT_ID, text: "Partition walls", start_date: "2027-03-05", duration: 5, scheduling_mode: "fixed_work", owner: [{ resource_id: 4, value: 8 }, { resource_id: 5, value: 4 }] },
{ id: 40, parent: PROJECT_ID, text: "Painting", start_date: "2027-03-12", duration: 10, scheduling_mode: "fixed_work", owner: [{ resource_id: 1, value: 8 }] },
{ id: 50, parent: PROJECT_ID, text: "Flooring", start_date: "2027-03-26", duration: 4, scheduling_mode: "fixed_work", owner: [{ resource_id: 4, value: 8 }] },
{ id: 60, parent: PROJECT_ID, text: "Furniture", start_date: "2027-04-01", duration: 3, scheduling_mode: "fixed_units", owner: [{ resource_id: 5, value: 4 }] },
{ id: 70, parent: PROJECT_ID, text: "Safety inspection", start_date: "2027-04-06", duration: 2, scheduling_mode: "fixed_duration", owner: [{ resource_id: 6, value: 8 }] },
{ id: MOVE_IN_ID, parent: PROJECT_ID, text: "Move-in day", type: "milestone", start_date: "2027-04-08", deadline: DEADLINE }
],
links: [
{ id: 1, source: 10, target: 20, type: "0" },
{ id: 2, source: 10, target: 30, type: "0" },
{ id: 3, source: 30, target: 40, type: "0" },
{ id: 4, source: 20, target: 40, type: "0" },
{ id: 5, source: 40, target: 50, type: "0" },
{ id: 6, source: 50, target: 60, type: "0" },
{ id: 7, source: 60, target: 70, type: "0" },
{ id: 8, source: 70, target: MOVE_IN_ID, type: "0" }
]
};
}
gantt.config.date_format = "%Y-%m-%d";
gantt.config.work_time = true;
gantt.config.row_height = 40;
gantt.config.bar_height = 24;
gantt.config.scale_height = 52;
gantt.config.min_column_width = 32;
gantt.config.open_tree_initially = true;
gantt.config.deadlines = true;
gantt.config.fit_tasks = true;
// the messages must not cover the two numbers of the header
gantt.message.position = "bottom";
gantt.config.effort = { enabled: true, mode: "fixed_work", work_unit: "hour", hours_per_day: 8 };
// "compress" moves the successors earlier when a task gets shorter
gantt.config.auto_scheduling = { enabled: true, gap_behavior: "compress" };
gantt.config.resources = true;
gantt.config.resource_store = "resource";
gantt.config.resource_property = "owner";
gantt.config.baselines.render_mode = "separateRow";
gantt.config.baselines.row_height = 12;
gantt.config.baselines.bar_height = 6;
gantt.config.scales = [
{ unit: "week", step: 1, format: "%M %j" },
{ unit: "day", step: 1, format: "%j" }
];
const { escape: escapeHtml, initials } = DHX.ui;
const formatNumber = value => String(Math.round(value * 10) / 10);
const formatDay = gantt.date.date_to_str("%D, %M %j");
const isMilestone = task => task.type === gantt.config.types.milestone;
const isWorkTask = task => !gantt.isSummaryTask(task) && !isMilestone(task);
const getPerson = id => gantt.getDatastore(gantt.config.resource_store).getItem(id);
const getHoursPerDay = task => gantt.getTaskAssignments(task.id).reduce((sum, assignment) => sum + Number(assignment.value), 0);
function avatarHtml(person) {
return `<span class="person_avatar" style="background:${person.color}" title="${escapeHtml(person.text)}">${initials(person.text)}</span>`;
}
function avatarsHtml(task) {
return gantt.getTaskResources(task.id).map(avatarHtml).join("");
}
function keptHtml(task, value, html) {
return isWorkTask(task) && modeOf(task).keeps === value ? `<span class="kept_value">${html}</span>` : html;
}
gantt.config.columns = [
{ name: "text", label: "Task", tree: true, width: 170, resize: true },
{ name: "people", label: "People", width: 112, template: task => {
if (!isWorkTask(task)) return "";
const avatars = avatarsHtml(task);
if (!avatars) return `<span class="person_list__empty">nobody yet</span>`;
const rate = keptHtml(task, "units", `${formatNumber(getHoursPerDay(task))} h/day`);
return `<span class="person_list">${avatars}<span class="person_list__rate">${rate}</span></span>`;
}, resize: true },
{ name: "work", label: "Work", width: 64, align: "center",
template: task => isMilestone(task) ? "" : keptHtml(task, "work", `${formatNumber(gantt.getTaskWork(task.id))} h`),
editor: { type: "number", map_to: "work", min: 1 }, resize: true },
{ name: "duration", label: "Days", width: 54, align: "center",
template: task => isMilestone(task) ? "" : keptHtml(task, "duration", `${task.duration} d`),
editor: { type: "number", map_to: "duration", min: 1 }, resize: true },
{ name: "scheduling_mode", label: "Scheduling", width: 124,
template: task => isWorkTask(task)
? `<span class="mode_pill mode_pill--${task.scheduling_mode}">${modeOf(task).label}</span>` : "",
editor: { type: "select", map_to: "scheduling_mode", options: modes.map(({ key, label }) => ({ key, label })) } }
];
gantt.templates.task_class = (start, end, task) => isWorkTask(task) ? `mode_${task.scheduling_mode}` : "";
gantt.templates.task_text = (start, end, task) => escapeHtml(task.text);
gantt.templates.rightside_text = (start, end, task) => isWorkTask(task)
? `<span class="bar_summary"><span class="person_list">${avatarsHtml(task)}</span>${formatNumber(gantt.getTaskWork(task.id))} h</span>` : "";
gantt.templates.timeline_cell_class = (task, date) => gantt.isWorkTime({ date, task }) ? "" : "weekend";
gantt.templates.scale_cell_class = date => gantt.isWorkTime({ date }) ? "" : "weekend";
/* resource histogram: the hours of each day against the capacity of the person */
function getAllocatedHours(date, tasks, resource) {
if (!gantt.isWorkTime({ date })) return 0;
return tasks.reduce((total, task) => total + gantt.getResourceAssignments(resource.id, task.id)
.reduce((sum, assignment) => sum + Number(assignment.value), 0), 0);
}
gantt.templates.histogram_cell_class = (start, end, resource, tasks) =>
getAllocatedHours(start, tasks, resource) > resource.capacity ? "column_overload" : "";
gantt.templates.histogram_cell_label = (start, end, resource, tasks) => {
const hours = getAllocatedHours(start, tasks, resource);
return hours ? formatNumber(hours) : "";
};
gantt.templates.histogram_cell_allocated = (start, end, resource, tasks) => getAllocatedHours(start, tasks, resource);
gantt.templates.histogram_cell_capacity = (start, end, resource) => gantt.isWorkTime({ date: start }) ? resource.capacity : 0;
const resourceColumns = [
{ name: "name", label: "Person", width: 170, template: resource =>
`<span class="resource_person">${avatarHtml(resource)}${escapeHtml(resource.text)}</span>` },
{ name: "role", label: "Role", width: 140, template: resource =>
`<span class="resource_role">${escapeHtml(resource.role)}</span>` },
{ name: "hours", label: "Assigned", width: 80, align: "center", template: resource => {
const hours = gantt.getResourceAssignments(resource.id)
.reduce((sum, assignment) => sum + Number(assignment.value) * gantt.getTask(assignment.task_id).duration, 0);
return hours ? `${formatNumber(hours)} h` : `<span class="resource_free">free</span>`;
} }
];
gantt.config.layout = {
css: "gantt_container",
rows: [
{ gravity: 3, cols: [
{ view: "grid", group: "grids", scrollY: "scrollVer" },
{ resizer: true, width: 1 },
{ view: "timeline", scrollX: "scrollHor", scrollY: "scrollVer" },
{ view: "scrollbar", id: "scrollVer", group: "vertical" }
] },
{ resizer: true, width: 1 },
{ gravity: 2,
config: { scale_height: 30, row_height: 38, scales: [{ unit: "day", step: 1, format: "%j" }], columns: resourceColumns },
cols: [
{ view: "resourceGrid", group: "grids", scrollY: "resourceVScroll" },
{ resizer: true, width: 1 },
{ view: "resourceHistogram", capacity: 12, scrollX: "scrollHor", scrollY: "resourceVScroll" },
{ view: "scrollbar", id: "resourceVScroll", group: "vertical" }
] },
{ view: "scrollbar", id: "scrollHor" }
]
};
gantt.config.toolbar = {
items: [
{ id: "original_plan", comp: "toggle", label: "Original plan", pressed: true },
"spacer",
{ id: "start_over", label: "Start over" }
]
};
/* context menu: the people and the scheduling mode of a task are two clicks away from its bar */
gantt.config.context_menu = {
task: [
{ id: "assign", label: "Assign people" },
{ id: "mode", label: "Scheduling mode" },
{ id: "effort_driven", label: "Keep work when people change" },
"|", "edit", "|", "delete"
],
link: ["delete_link"],
empty: ["add_task"]
};
const effortMenuItems = ["assign", "mode", "effort_driven"];
gantt.attachEvent("onBeforeContextMenu", context => {
if (context.zone !== "task") return true;
const task = context.task;
if (!isWorkTask(task)) {
context.items = context.items.filter(item => !effortMenuItems.includes(item.id));
return true;
}
const assigned = gantt.getTaskAssignments(task.id).map(assignment => String(assignment.resource_id));
context.items.forEach(item => {
if (item.id === "assign") {
item.items = people.map(person => ({
id: `assign:${person.id}`,
label: `${person.text} (${person.role})`,
checked: assigned.includes(String(person.id))
}));
} else if (item.id === "mode") {
item.items = modes.map(mode => ({
id: `mode:${mode.key}`, label: mode.label, radio: true, checked: task.scheduling_mode === mode.key
}));
} else if (item.id === "effort_driven") {
item.checked = !!task.effort_driven;
// a fixed-work task always keeps its work
item.disabled = task.scheduling_mode === "fixed_work";
}
});
return true;
});
function togglePerson(task, personId) {
const assignments = (task[gantt.config.resource_property] || []).slice();
const index = assignments.findIndex(assignment => String(assignment.resource_id) === String(personId));
if (index === -1) {
assignments.push({ resource_id: personId, value: getPerson(personId).capacity });
} else {
assignments.splice(index, 1);
}
task[gantt.config.resource_property] = assignments;
}
gantt.attachEvent("onContextMenuItemClick", (id, item, context) => {
const [action, value] = String(id).split(":");
if (context.zone !== "task" || !effortMenuItems.includes(action)) return true;
const task = gantt.getTask(context.id);
if (action === "assign") {
togglePerson(task, Number(value));
} else if (action === "mode") {
task.scheduling_mode = value;
} else {
task.effort_driven = !task.effort_driven;
}
gantt.updateTask(task.id);
// auto scheduling starts after a user action on the dates, and an API change is not one
gantt.autoSchedule();
return true;
});
/* task form: the effort values are next to the dates and the people */
gantt.config.lightbox.advanced = true;
gantt.config.lightbox.sections = {
tabs: [
{ name: "general", children: [
{ name: "description", height: 44, map_to: "text", type: "textarea", focus: true },
{ cols: [
{ name: "work", type: "work", label: "Work, hours" },
{ name: "scheduling_mode", type: "scheduling_mode" }
] },
{ name: "effort_driven", type: "effort_driven", label: "Keep work when people change" },
{ name: "time", type: "duration", map_to: "auto" }
] },
{ name: "resources", label: "People", children: [{ name: "resources", type: "resource_selector", map_to: "auto" }] },
{ name: "predecessors", children: [{ name: "predecessors", type: "predecessors" }] },
{ name: "successors", children: [{ name: "successors", type: "successors" }] },
{ name: "advanced", children: [
{ name: "deadline", type: "datepicker", map_to: "deadline" },
{ name: "progress", type: "progress", map_to: "progress" }
] }
]
};
// a change of the people or the work in the form is not a change of the dates,
// so the plan is rescheduled after each save
let isFormSaved = false;
gantt.attachEvent("onLightboxSave", () => {
isFormSaved = true;
return true;
});
gantt.attachEvent("onAfterLightbox", () => {
if (isFormSaved) {
isFormSaved = false;
gantt.autoSchedule();
}
});
/* after each change, a message names the task and the values that changed */
const effortValues = new Map();
const readEffortValues = task => ({
duration: task.duration,
work: gantt.getTaskWork(task.id),
rate: getHoursPerDay(task)
});
function rememberEffortValues() {
effortValues.clear();
gantt.eachTask(task => {
if (isWorkTask(task)) effortValues.set(String(task.id), readEffortValues(task));
});
}
function reportChanges() {
gantt.eachTask(task => {
const before = effortValues.get(String(task.id));
if (!before || !isWorkTask(task)) return;
const now = readEffortValues(task);
const changes = [];
if (now.duration !== before.duration) changes.push(`${before.duration} → <b>${now.duration} days</b>`);
if (now.work !== before.work) changes.push(`${formatNumber(before.work)} → <b>${formatNumber(now.work)} h of work</b>`);
if (now.rate !== before.rate) changes.push(`${formatNumber(before.rate)} → <b>${formatNumber(now.rate)} h/day</b>`);
if (changes.length) {
gantt.message({ text: `<b>${escapeHtml(task.text)}</b><br>${changes.join("<br>")}`, expire: 5000 });
}
});
rememberEffortValues();
updateKpis(true);
}
// one user action updates several tasks: report once, after the last update
let reportTimer = null;
function scheduleReport() {
clearTimeout(reportTimer);
reportTimer = setTimeout(reportChanges, 50);
return true;
}
gantt.attachEvent("onAfterTaskUpdate", scheduleReport);
gantt.attachEvent("onAfterTaskAdd", scheduleReport);
gantt.attachEvent("onAfterTaskDelete", scheduleReport);
/* header numbers */
let plannedWork = null;
let kpiState = "";
function updateKpis(highlight) {
if (!gantt.isTaskExists(MOVE_IN_ID) || !gantt.isTaskExists(PROJECT_ID)) return;
const moveIn = gantt.getTask(MOVE_IN_ID);
const deadline = moveIn.deadline;
const isLate = moveIn.start_date > deadline;
// calculateDuration needs the earlier date first
const days = gantt.calculateDuration({
start_date: isLate ? deadline : moveIn.start_date,
end_date: isLate ? moveIn.start_date : deadline,
task: moveIn
});
const work = gantt.getTaskWork(PROJECT_ID);
if (plannedWork === null) plannedWork = work;
const extraWork = work - plannedWork;
const moveInNode = document.getElementById("kpi_move_in");
moveInNode.className = `effort_kpi effort_kpi--${isLate ? "late" : "ok"}`;
moveInNode.querySelector(".effort_kpi__value").textContent = formatDay(moveIn.start_date);
moveInNode.querySelector(".effort_kpi__delta").textContent = days
? `${days} ${days === 1 ? "day" : "days"} ${isLate ? "late" : "early"}` : "on time";
const workNode = document.getElementById("kpi_work");
workNode.className = `effort_kpi${extraWork > 0 ? " effort_kpi--more" : ""}`;
workNode.querySelector(".effort_kpi__value").textContent = `${formatNumber(work)} h`;
workNode.querySelector(".effort_kpi__delta").textContent = extraWork
? `${extraWork > 0 ? "+" : "−"}${formatNumber(Math.abs(extraWork))} h` : "as planned";
const state = `${+moveIn.start_date}/${work}`;
if (highlight && state !== kpiState) {
[moveInNode, workNode].forEach(node => {
// the reflow between the two class changes starts the animation again
node.classList.remove("effort_kpi--changed");
void node.offsetWidth;
node.classList.add("effort_kpi--changed");
});
}
kpiState = state;
}
/* the original plan is the baseline of each task */
function showOriginalPlan(show) {
gantt.config.baselines.render_mode = show ? "separateRow" : false;
gantt.render();
}
function loadPlan() {
gantt.clearAll();
plannedWork = null;
gantt.parse(getPlan());
gantt.batchUpdate(() => {
gantt.eachTask(task => {
task.baselines = [{ id: gantt.uid(), task_id: task.id, start_date: task.start_date, end_date: task.end_date }];
gantt.updateTask(task.id);
});
});
gantt.addMarker({
start_date: gantt.date.str_to_date(gantt.config.date_format)(DEADLINE),
css: "deadline_marker",
text: "Move-in deadline"
});
rememberEffortValues();
updateKpis(false);
}
gantt.attachEvent("onToolbarItemClick", id => {
if (id === "start_over") {
clearTimeout(reportTimer);
loadPlan();
}
return true;
});
gantt.attachEvent("onToolbarItemChange", (id, value) => {
if (id === "original_plan") showOriginalPlan(value);
return true;
});
document.getElementById("legend").innerHTML = modes.map(mode =>
`<span class="effort_legend__item"><i class="effort_legend__swatch effort_legend__swatch--${mode.key}"></i><b>${mode.label}</b> ${mode.rule}</span>`
).join("") + `<span class="effort_legend__item"><i class="effort_legend__swatch effort_legend__swatch--baseline"></i>Original plan</span>`;
gantt.init("gantt_here");
loadPlan();<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Effort-driven planning: add people, move the finish date</title>
<script src="../../codebase/dhtmlxgantt.js?v=10.0.0"></script>
<link rel="stylesheet" href="../../codebase/dhtmlxgantt.css?v=10.0.0">
<link rel="stylesheet" href="../common/demo-controls/dhx_controls.css">
<script src="../common/demo-controls/dhx_controls.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap">
<style>
:root {
--mode-work: #2563eb;
--mode-units: #7c3aed;
--mode-duration: #d97706;
--plan-baseline: #cbd5e1;
}
body { display: flex; flex-direction: column; }
#gantt_here { flex: 1 1 auto; min-height: 0; width: 100%; }
/* header: the question on the left, the two numbers that every change moves on the right */
.effort_header { height: auto; min-height: 68px; padding-top: 8px; padding-bottom: 8px; }
.effort_header__title { font: 700 16px var(--dhx-font); color: var(--dhx-ink); }
.effort_header__lead { font: 500 12.5px var(--dhx-font); color: var(--dhx-ink-2); margin-top: 3px; }
.effort_kpis { display: flex; gap: 10px; flex: none; }
.effort_kpi {
display: grid; grid-template-columns: auto auto; column-gap: 10px; align-items: baseline;
min-width: 170px; padding: 7px 14px; box-sizing: border-box;
border: 1px solid var(--dhx-line); border-radius: 10px; background: var(--dhx-surface);
}
.effort_kpi__label {
grid-column: 1 / 3; font: 600 10.5px var(--dhx-font); letter-spacing: .04em;
text-transform: uppercase; color: var(--dhx-muted);
}
.effort_kpi__value { font: 700 16px var(--dhx-font); color: var(--dhx-ink); white-space: nowrap; }
.effort_kpi__delta {
justify-self: end; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
font: 600 12px var(--dhx-font); background: var(--dhx-neutral-bg); color: var(--dhx-neutral-ink);
}
.effort_kpi--late { border-color: var(--dhx-danger-line); background: var(--dhx-danger-bg); }
.effort_kpi--late .effort_kpi__delta { background: var(--dhx-surface); color: var(--dhx-danger-ink); }
.effort_kpi--ok { border-color: var(--dhx-ok-line); background: var(--dhx-ok-bg); }
.effort_kpi--ok .effort_kpi__delta { background: var(--dhx-surface); color: var(--dhx-ok-ink); }
.effort_kpi--more .effort_kpi__delta { background: var(--dhx-warn-bg); color: var(--dhx-warn-ink); }
.effort_kpi--changed { animation: effort_kpi_changed .9s ease-out; }
@keyframes effort_kpi_changed {
0% { box-shadow: 0 0 0 4px rgba(37,99,235,.35); }
100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
}
/* the bar color is the scheduling mode of the task */
.gantt_task_line { border: none; border-radius: 7px; box-shadow: 0 1px 2px rgba(16,24,40,.18); }
.gantt_task_line.mode_fixed_work { background: var(--mode-work); }
.gantt_task_line.mode_fixed_units { background: var(--mode-units); }
.gantt_task_line.mode_fixed_duration { background: var(--mode-duration); }
.gantt_task_line.gantt_project { background: #94a3b8; border-radius: 5px; }
.gantt_task_line .gantt_task_content { font: 600 12px var(--dhx-font); }
.gantt_task_baseline.gantt_task_baseline_0 { background: var(--plan-baseline); border-radius: 3px; opacity: 1; }
.gantt_task_cell.weekend,
.gantt_scale_cell.weekend { background: rgba(15,23,42,.04); }
.gantt_marker.deadline_marker { background: var(--dhx-danger-solid); }
.gantt_marker.deadline_marker .gantt_marker_content { background: var(--dhx-danger-solid); font: 600 11px var(--dhx-font); }
.person_avatar {
display: inline-flex; align-items: center; justify-content: center; flex: none;
width: 22px; height: 22px; border-radius: 50%; color: #fff; font: 700 10px var(--dhx-font);
box-shadow: 0 0 0 2px var(--dhx-surface);
}
.person_list { display: inline-flex; align-items: center; vertical-align: middle; }
.person_list .person_avatar + .person_avatar { margin-left: -5px; }
.person_list__rate { margin-left: 8px; font: 500 12px var(--dhx-font); color: var(--dhx-muted); }
.person_list__empty { font: 500 12px var(--dhx-font); color: var(--dhx-muted); }
.bar_summary { display: inline-flex; align-items: center; gap: 8px; font: 600 12px var(--dhx-font); color: var(--dhx-ink-2); }
/* the pill names the scheduling mode; the lock marks the value that the task keeps */
.mode_pill {
display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px;
font: 600 11.5px var(--dhx-font); line-height: 16px; vertical-align: middle;
}
.mode_pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.mode_pill--fixed_work { background: #eaf1fe; color: var(--mode-work); }
.mode_pill--fixed_units { background: #f1eafe; color: var(--mode-units); }
.mode_pill--fixed_duration { background: #fff4e0; color: #b45309; }
.kept_value { font-weight: 700; color: var(--dhx-ink); }
.kept_value::after {
content: ""; display: inline-block; width: 8px; height: 10px; margin-left: 4px; opacity: .5;
background: currentColor;
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 14'%3E%3Cpath d='M3 6V4a3 3 0 0 1 6 0v2h1a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1.5 0h3V4a1.5 1.5 0 0 0-3 0z'/%3E%3C/svg%3E") center / contain no-repeat;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 14'%3E%3Cpath d='M3 6V4a3 3 0 0 1 6 0v2h1a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1.5 0h3V4a1.5 1.5 0 0 0-3 0z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.gantt_histogram_fill { background: #c7d7fb; }
.column_overload .gantt_histogram_fill { background: #f3a6a6; }
.resource_person { display: inline-flex; align-items: center; gap: 8px; }
.resource_role { color: var(--dhx-muted); font-weight: 500; }
.resource_free { color: var(--dhx-ok-ink); font-weight: 600; }
.effort_legend { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.effort_legend__item { display: inline-flex; align-items: center; gap: 7px; font: 500 12px var(--dhx-font); color: var(--dhx-ink-2); }
.effort_legend__item b { color: var(--dhx-ink); font-weight: 600; }
.effort_legend__swatch { width: 14px; height: 10px; border-radius: 3px; }
.effort_legend__swatch--fixed_work { background: var(--mode-work); }
.effort_legend__swatch--fixed_duration { background: var(--mode-duration); }
.effort_legend__swatch--fixed_units { background: var(--mode-units); }
.effort_legend__swatch--baseline { background: var(--plan-baseline); }
@media (max-width: 900px) {
.effort_header__lead { display: none; }
.effort_kpi { min-width: 0; }
}
</style>
</head>
<body>
<div class="dhx_header effort_header">
<div>
<div class="effort_header__title">Office fit-out: can we still move in on time?</div>
<div class="effort_header__lead">Right-click a task and add a person. Blue tasks get shorter, orange tasks only cost more.</div>
</div>
<div class="dhx_spacer"></div>
<div class="effort_kpis">
<div class="effort_kpi" id="kpi_move_in">
<span class="effort_kpi__label">Move-in day</span>
<span class="effort_kpi__value"></span>
<span class="effort_kpi__delta"></span>
</div>
<div class="effort_kpi" id="kpi_work">
<span class="effort_kpi__label">Total work</span>
<span class="effort_kpi__value"></span>
<span class="effort_kpi__delta"></span>
</div>
</div>
</div>
<div id="gantt_here"></div>
<div class="dhx_footer">
<div class="effort_legend" id="legend"></div>
</div>
</body>
</html>