Gantt Chart in Read-Only Mode
A Gantt chart locked for viewing: no dragging or editing, just the plan to read, scroll and point at, until the toolbar’s pencil button unlocks it.
About this chart
When to lock a Gantt chart
Most people who open a plan only need to read it. Read-only mode hides the grips, buttons and connector dots that invite changes, so the chart is calmer and nobody moves a task by accident, while the people who plan can still switch editing on.
Good for
- Status pages and reports
- Sharing a plan with clients or the whole team
- A schedule inside a dashboard
Think twice when
- Everyone needs to edit: leave editing on
- Keeping changes out for real: check them on your server, a hidden button is not access control
- A printed plan: export an image instead
For developers
Get the code.
Built with amCharts 5, a JavaScript library. The code includes your theme and renderer (canvas or SVG), but not the changes you make with the controls.
For projects that use npm:
How it reads:
Using Claude or ChatGPT? Install the amCharts plugin first (Claude, ChatGPT), so it works from our docs and examples.
npm install @amcharts/amcharts5. See Getting started.
The same chart as a JSON config. Gantt reads and writes this format, the library's JSON parser turns it into a chart, and the <am5-chart> element puts it on a page with no code.How it reads:
"type" is the class to create and "settings" what you would pass to its new() in code; "properties" fill in its parts, lists such as series and axes or templates such as columns.template; "refs" holds objects used in more than one place ("#series-0" stands for the one named series-0); a string starting with "@" takes a value from another object, such as "@series.get('fill')".
A complete page. Save it as an .html file and open it in a browser.
Paste this into an AI coding assistant to build the chart from scratch. More in amCharts & AI.Using Claude or ChatGPT? Install the amCharts plugin first (Claude, ChatGPT), so it works from our docs and examples.
var root = am5.Root.new("chartdiv");
// Set themes
// https://docs.amcharts.com/v5/concepts/themes/
root.setThemes([
am5themes_Animated.new(root),
am5themes_ResponsiveMax.new(root)
]);
// Create Gantt chart
// https://docs.amcharts.com/v5/charts/gantt/
var gantt = root.container.children.push(am5gantt.Gantt.new(root, {}));
gantt.get("colors").set("step", 3); // each new color three steps along the palette, so neighbors contrast
gantt.editButton.set("visible", true); // show the edit button (hidden by default)
// the chart starts read-only; the edit button turns editing on
gantt.set("editable", false);
// Hide a date label that would be cut off at the left edge of the timeline
gantt.xAxis.get("renderer").labels.template.set("minPosition", 0.08);
// Set category data
// https://docs.amcharts.com/v5/charts/gantt/#category-data
gantt.yAxis.data.setAll([{
name: "Idea",
id: "gantt_0"
}, {
name: "Kick-off",
id: "gantt_1"
}, {
name: "Planning",
id: "gantt_2"
}, {
name: "Development",
id: "gantt_3"
}, {
name: "Testing",
id: "gantt_4"
}, {
name: "Finalization",
id: "gantt_5"
}, {
name: "Release",
id: "gantt_6"
}]);
// Set series data
// https://docs.amcharts.com/v5/charts/gantt/#series-data
gantt.series.data.setAll([{
start: 1758142800000, // a timestamp in milliseconds
// duration 0 draws a milestone
duration: 0,
progress: 1, // how much is done: 0 not started, 1 finished
id: "gantt_0",
linkTo: ["gantt_1"] // an arrow to the task that follows
}, {
start: 1758142800000,
duration: 2, // 2 working days: weekends don't count by default
progress: 1,
id: "gantt_1",
linkTo: ["gantt_2"]
}, {
start: 1758488400000,
duration: 2,
progress: 0.2,
id: "gantt_2",
linkTo: ["gantt_3"]
}, {
start: 1758661200000,
duration: 1,
progress: 0.8,
id: "gantt_3",
linkTo: ["gantt_4"]
}, {
start: 1758747600000,
duration: 3,
progress: 0,
id: "gantt_4",
linkTo: ["gantt_5"]
}, {
start: 1759179600000,
duration: 0,
progress: 0,
id: "gantt_5",
linkTo: ["gantt_6"]
}, {
start: 1759179600000,
duration: 4,
progress: 0,
id: "gantt_6"
}]);
// Accessibility: keyboard and screen reader support
// https://docs.amcharts.com/v5/concepts/accessibility/
gantt.setAll({
focusable: true, // Tab reaches the chart, and a screen reader names it
role: "figure",
ariaLabel: "Read-only Gantt chart of a seven-phase project, from idea to release. Tab to the date range and the toolbar; its Edit mode button unlocks editing"
});
// the Gantt brings its own keyboard support: the date range and the toolbar buttons are focusable by the library
gantt.appear();



