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, "asTable");
6
chart.editing(true);
7
8
var timeLine = chart.getTimeline();
9
10
var customRangeMarker = timeLine.rangeMarker();
11
customRangeMarker.from("2000-02-25 00:00:00");
12
customRangeMarker.to("2000-02-26 00:00:00");
13
14
// Sets fill settings.
15
customRangeMarker.fill({
16
src: "https://static.anychart.com/images/beach.png",
17
mode: "stretch",
18
opacity: 0.5
19
});
20
21
chart.title("Set range marker fill as an image");
22
chart.container("container");
23
chart.draw();
24
chart.fitAll();
25
});
26
27
function getData() {
28
return [
29
{
30
"id": "1",
31
"name": "Phase 1 - Strategic Plan",
32
"progressValue": "14%",
33
"actualStart": "2000-02-24 08:00:00",
34
"actualEnd": "2000-02-27 08:00:00"
35
},
36
{
37
"id": "2",
38
"name": "Self-Assessment",
39
parent: "1",
40
"progressValue": "25%",
41
"actualStart": "2000-02-24 08:00:00",
42
"actualEnd": "2000-02-29 08:00:00",
43
"baselineStart": "2000-02-27 08:00:00",
44
"baselineEnd": "2000-02-28 08:00:00"
45
},
46
{
47
"id": "3",
48
"name": "Define business vision",
49
parent: "2",
50
"progressValue": "0%",
51
"actualStart": "2000-02-25 00:00:00",
52
"actualEnd": "2000-02-25 09:00:00",
53
"connectTo": "4",
54
"connectorType": "FinishStart"
55
},
56
{
57
"id": "4",
58
"name": "Identify available skills, information and support",
59
parent: "2",
60
"progressValue": "0%",
61
"actualStart": "2000-02-26 00:00:00",
62
"actualEnd": "2000-02-26 09:00:00",
63
"connectTo": "5",
64
"connectorType": "FinishStart"
65
},
66
{
67
"id": "5",
68
"name": "Decide whether to proceed",
69
parent: "2",
70
"progressValue": "0%",
71
"actualStart": "2000-02-27 08:00:00",
72
"actualEnd": "2000-02-28 08:00:00",
73
"connectTo": "6",
74
"connectorType": "FinishStart"
75
},
76
{
77
"id": "6",
78
"name": "Define the Opportunity",
79
parent: "1",
80
"progressValue": "27%",
81
"actualStart": "2000-02-28 08:00:00",
82
"actualEnd": "2000-02-29 08:00:00"
83
},
84
{
85
"id": "7",
86
"name": "Research the market and competition",
87
parent: "6",
88
"progressValue": "0%",
89
"actualStart": "2000-02-26 08:00:00",
90
"actualEnd": "2000-02-27 08:00:00",
91
"connectTo": "8",
92
"connectorType": "FinishStart"
93
}
94
];
95
}