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