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
// To change the way how context menu looks you need to change CSS.
3
// By default CSS from AnyChart CDN is used: https://cdn.anychart.com/css/7.14.3/anychart-ui.css
4
// Download it, alter, upload to your server and link from your pages to change the look.
5
6
var data = [
7
{
8
id: 1,
9
name: "Phase 1 - Strategic Plan",
10
progressValue: "14%",
11
actualStart: 951350400000,
12
actualEnd: 951609600000
13
},
14
{
15
id: 2,
16
name: "Self-Assessment",
17
parent: 1,
18
progressValue: "25%",
19
actualStart: 951350400000,
20
actualEnd: 951782400000
21
},
22
{
23
id: 3,
24
name: "Define business vision",
25
parent: 2,
26
progressValue: "0%",
27
actualStart: 951408000000,
28
actualEnd: 951440400000,
29
connectTo: "4",
30
connectorType: "FinishStart"
31
},
32
{
33
id: 4,
34
name: "Identify available skills, information and support",
35
parent: "2",
36
progressValue: "0%",
37
actualStart: 951494400000,
38
actualEnd: 951526800000,
39
connectTo: "5",
40
connectorType: "FinishStart"
41
},
42
{
43
id: 5,
44
name: "Decide whether to proceed",
45
parent: 2,
46
progressValue: "0%",
47
actualStart: 951609600000,
48
actualEnd: 951696000000,
49
connectTo: "6",
50
connectorType: "FinishStart"
51
},
52
{
53
id: 6,
54
name: "Define the Opportunity",
55
parent: 1,
56
progressValue: "27%",
57
actualStart: 951696000000,
58
actualEnd: 951782400000
59
}
60
];
61
62
var chart = anychart.ganttProject();
63
64
var toolbar = anychart.ui.ganttToolbar();
65
toolbar.container("container");
66
toolbar.target(chart);
67
toolbar.printPaperSizes(["A0", "A4"]);
68
toolbar.draw();
69
70
chart.data(data, "asTable");
71
72
// Get the paper size for print.
73
var printPaperSizes = toolbar.printPaperSizes();
74
75
var dataGrid = chart.dataGrid();
76
77
var column = dataGrid.column(1);
78
column.title("Paper sizes - " + printPaperSizes + ".");
79
80
chart.container("container");
81
chart.draw();
82
chart.fitAll();
83
});