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 textMarker = timeLine.textMarker();
10
textMarker.value('2000-02-27T00:00:00');
11
textMarker.background({stroke: '2 #F44336'});
12
13
// Set text marker padding.
14
textMarker.padding(5, 0, 5, 10);
15
16
chart.title('Set text marker padding by several values');
17
chart.container('container');
18
chart.draw();
19
chart.fitAll();
20
});
21
22
function getData() {
23
return [
24
{id: 1, name: 'Phase 1 - Strategic Plan', progressValue: 0.14, actualStart: '2000-02-24T08:00:00', actualEnd: '2000-02-27T08:00:00'},
25
{id: 2, name: 'Self-Assessment', parent: 1, progressValue: 0.25, actualStart: '2000-02-24T08:00:00', actualEnd: '2000-02-29T08:00:00', baselineStart: '2000-02-27T08:00:00', baselineEnd: '2000-02-28T08:00:00'},
26
{id: 3, name: 'Define business vision', parent: 2, progressValue: 0, actualStart: '2000-02-25T00:00:00', actualEnd: '2000-02-25T09:00:00', connectTo: 4},
27
{id: 4, name: 'Identify available skills, information and support', parent: 2, progressValue: '0%', actualStart: '2000-02-26T00:00:00', actualEnd: '2000-02-26T09:00:00', connectTo: 5},
28
{id: 5, name: 'Decide whether to proceed', parent: 2, progressValue: 0, actualStart: '2000-02-27T08:00:00', actualEnd: '2000-02-28T08:00:00', connectTo: 6,},
29
{id: 6, name: 'Define the Opportunity', parent: 1, progressValue: 0.27, actualStart: '2000-02-28T08:00:00', actualEnd: '2000-02-29T08:00:00'},
30
{id: 7, name: 'Research the market and competition', parent: 6, progressValue: 0, actualStart: '2000-02-26T08:00:00', actualEnd: '2000-02-27T08:00:00'}
31
];
32
}