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
anychart.data.loadJsonFile('https://cdn.anychart.com/gantt-data/milestone-previews.json', function(data) {
3
var chart = anychart.ganttProject();
4
chart.data(data, 'as-table');
5
6
var timeLine = chart.getTimeline();
7
8
// Enable milestone previews and their labels.
9
var preview = timeLine.milestones().preview();
10
preview.enabled(true);
11
preview.labels(true);
12
13
// Set cropLabels and enable milestone preview labels cropping.
14
timeLine.cropLabels(true);
15
16
chart.title('Set labels crop');
17
chart.container('container');
18
chart.draw();
19
chart.fitAll();
20
})
21
});