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.pert();
5
chart.data(data, 'as-table');
6
chart.title('Click on the chart');
7
8
// Set event listener on the chart.
9
chart.listenOnce('click', function (e) {
10
chart.title('You can\'t click anymore');
11
});
12
13
chart.container('container');
14
chart.draw();
15
});
16
17
function getData() {
18
return [
19
{id: 'A1', duration: 1, name: 'Task A'},
20
{id: 'A2', duration: 3, name: 'Task B'},
21
{id: 'A3', duration: 3, name: 'Task C'},
22
{id: 'A4', duration: 1, name: 'Task D'},
23
{id: 'A5', duration: 2, name: 'Task AD', dependsOn: ['A1', 'A4']},
24
{id: 'A6', duration: 2, name: 'Task BC', dependsOn: ['A2', 'A3']}
25
];
26
}