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
7
var timeline = chart.getTimeline();
8
9
// Get live edit settings.
10
var edit = timeline.edit();
11
12
edit.enabled(true);
13
edit.fill('#66cd00 0.3');
14
15
chart.defaultRowHeight(50);
16
chart.title('Drag the row to see the changed fill of the edit structure preview control');
17
chart.container('container');
18
chart.draw();
19
20
chart.fitAll();
21
});
22
23
function getData() {
24
return [
25
{id: 1, name: 'Drag this task 1', progressValue: 0.14, actualStart: '2000-02-24', actualEnd: '2000-02-27'},
26
{id: 2, name: 'Drag this task 2', progressValue: 0.25, actualStart: '2000-02-24', actualEnd: '2000-02-29'},
27
{id: 3, name: 'Drag this task 3', progressValue: 0, actualStart: '2000-02-24T24:00', actualEnd: '2000-02-25T09:00', connectTo: 4},
28
{id: 4, name: 'Drag this task 4', progressValue: 0, actualStart: '2000-02-26T00:00', actualEnd: '2000-02-26T09:00', connectTo: 5},
29
{id: 5, name: 'Drag this task 5', progressValue: 0, actualStart: '2000-02-27', actualEnd: '2000-02-28T08:00', connectTo: 6},
30
{id: 6, name: 'Drag this task 6', progressValue: 0.27, actualStart: '2000-02-28T08:00', actualEnd: '2000-02-29'},
31
{id: 7, name: 'Drag this task 7', progressValue: 0, actualStart: '2000-02-26T08:00', actualEnd: '2000-02-27', connectTo: 8}
32
];
33
}