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 dataSet = anychart.data.set([
3
{x: "Physical", value: 70},
4
{x: "Data Link", value: 60},
5
{x: "Network", value: 50},
6
{x: "Transport", value: 40},
7
{x: "Session", value: 30},
8
{x: "Presentation", value: 20},
9
{x: "Application", value: 10}
10
]);
11
var chart = anychart.pyramid(dataSet);
12
13
var labels = chart.labels();
14
labels.position("outsideLeft");
15
16
// Get connector length.
17
var connectorLength = chart.connectorLength();
18
19
chart.title("The current connector length is " + connectorLength + ".");
20
chart.container("container");
21
chart.draw();
22
});