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