HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
var data = getData();
3
4
var chart = anychart.ganttProject();
5
chart.data(data, 'as-table');
6
chart.defaultRowHeight(50);
7
8
var edit = chart.edit();
9
10
// Enable live edit.
11
edit.enabled(true);
12
13
chart.title('Enable live edit of the chart (enables live edit of all elements by default). \n Drag the row');
14
chart.container('container');
15
chart.draw();
16
17
chart.fitAll();
18
});
19
20
function getData() {
21
return [
22
{id: 1, name: 'Drag this task 1', progressValue: 0.14, actualStart: '2000-02-24', actualEnd: '2000-02-27'},
23
{id: 2, name: 'Drag this task 2', progressValue: 0.25, actualStart: '2000-02-24', actualEnd: '2000-02-29'},
24
{id: 3, name: 'Drag this task 3', progressValue: 0, actualStart: '2000-02-24T24:00', actualEnd: '2000-02-25T09:00', connectTo: 4},
25
{id: 4, name: 'Drag this task 4', progressValue: 0, actualStart: '2000-02-26T00:00', actualEnd: '2000-02-26T09:00', connectTo: 5},
26
{id: 5, name: 'Drag this task 5', progressValue: 0, actualStart: '2000-02-27', actualEnd: '2000-02-28T08:00', connectTo: 6},
27
{id: 6, name: 'Drag this task 6', progressValue: 0.27, actualStart: '2000-02-28T08:00', actualEnd: '2000-02-29'},
28
{id: 7, name: 'Drag this task 7', progressValue: 0, actualStart: '2000-02-26T08:00', actualEnd: '2000-02-27', connectTo: 8}
29
];
30
}