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
// set the data with three time estimates
3
var data = [
4
{id: "1", optimistic: 1, pessimistic: 10, mostLikely: 6, name: "A"},
5
{id: "2", optimistic: 3, pessimistic: 8, mostLikely: 5, name: "B"},
6
{id: "3", optimistic: 1, pessimistic: 4, mostLikely: 3, name: "D"},
7
{id: "4", optimistic: 2, pessimistic: 12, mostLikely: 5, name: "AD", dependsOn: ["1", "3"]},
8
{id: "5", optimistic: 4, pessimistic: 16, mostLikely: 10, name: "BC", dependsOn: ["2", "3"]}
9
];
10
11
// create a chart
12
var chart = anychart.pert();
13
// set data
14
chart.data(data, "as-table");
15
16
// set chart title
17
chart.title("Nodes and Connections Set Simultaneously");
18
19
// display the chart
20
chart.container("container");
21
chart.draw();
22
});