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 stage = anychart.graphics.create('container');
3
4
var treeData = anychart.data.tree([
5
{id: 1, name: 'Phase 1 - Strategic Plan'},
6
{id: 2, name: 'Self-Assessment'},
7
{id: 3, name: '14%', parent: 1},
8
{id: 4, name: '25%', parent: 2},
9
{id: 5, name: 'Define business vision'},
10
{id: 6, name: 'Identify available skills'},
11
{id: 7, name: 'Decide whether to proceed'},
12
{id: 8, name: 'Define the Opportunity'},
13
{id: 9, name: 'Research the market and competition'},
14
{id: 10, name: 'Interview owners of similar businesses'},
15
{id: 11, name: 'Identify needed resources'},
16
{id: 12, name: 'Identify operating cost elements'}
17
], 'as-table');
18
19
var dataGrid = anychart.standalones.dataGrid();
20
dataGrid.data(treeData);
21
dataGrid.headerHeight(25);
22
23
// Set vertical scroll bar settings.
24
dataGrid.verticalScrollBar({sliderFill: '#F44336'});
25
26
var column = dataGrid.column(0);
27
column.width(60);
28
29
dataGrid.bounds(0, 0, '16%', '30%');
30
dataGrid.container(stage);
31
dataGrid.draw();
32
});