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 tasks = timeLine.tasks();
10
11
var progress = tasks.progress();
12
13
// Set progress fill
14
progress.fill({
15
src: 'https://static.anychart.com/images/beach.png',
16
mode: 'stretch'
17
});
18
19
chart.title('Set fill as an image');
20
chart.container('container');
21
chart.draw();
22
chart.fitAll();
23
});
24
25
function getData() {
26
return [
27
{id: 1, name: 'Phase 1 - Strategic Plan', progressValue: 0.14, actualStart: '2000-02-24', actualEnd: '2000-02-27'},
28
{id: 2, name: 'Self-Assessment', parent: 1, progressValue: 0.25, actualStart: '2000-02-24', actualEnd: '2000-02-29'},
29
{id: 3, name: 'Define business vision', parent: 2, progressValue: 0.1, actualStart: '2000-02-24T24:00', actualEnd: '2000-02-25T09:00', connector: [{connectTo: 4}]},
30
{id: 4, name: 'Identify available skills, information and support', parent: 2, progressValue: 0.34, actualStart: '2000-02-26T00:00', actualEnd: '2000-02-26T09:00', connector: [{connectTo: 5}]},
31
{id: 5, name: 'Decide whether to proceed', parent: 2, progressValue: 0, actualStart: '2000-02-27', actualEnd: '2000-02-28T08:00', connector: [{connectTo: 6}]},
32
{id: 6, name: 'Define the Opportunity', parent: 1, progressValue: 0.27, actualStart: '2000-02-28T08:00', actualEnd: '2000-02-29'},
33
{id: 7, name: 'Research the market and competition', parent: 6, progressValue: 0, actualStart: '2000-02-26T08:00', actualEnd: '2000-02-27'}
34
];
35
}