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 pyramidChart = anychart.pyramid([
5
{x: "Physical", value: 125},
6
{x: "Data Link", value: 125},
7
{x: "Network", value: 125},
8
{x: "Transport", value: 125},
9
{x: "Session", value: 125},
10
{x: "Presentation", value: 125},
11
{x: "Application", value: 290, label: {anchor: "centerTop"}}
12
]);
13
14
pyramidChart.markers(true);
15
pyramidChart.labels(false);
16
pyramidChart.bounds(0, 20, "50%", "100%");
17
pyramidChart.markers({position: "leftTop", size: 10});
18
pyramidChart.markerPalette(["diamond", "star4", "star7", "diagonalCross", "trapezium", "pentagon"]);
19
pyramidChart.container(stage);
20
pyramidChart.draw();
21
22
var markerChart = anychart.column();
23
markerChart.marker([5, 40, 6, 37, 15]);
24
markerChart.marker([7, 23, 9, 18, 28]);
25
markerChart.marker([11, 17, 12, 34, 19]);
26
markerChart.marker([13, 7, 22, 14, 39]);
27
markerChart.bounds("50%", 20, "50%", "100%");
28
29
// Get marker palette of the funnel chart.
30
var pyramidChartMarkerPalette = pyramidChart.markerPalette();
31
32
markerChart.markerPalette(pyramidChartMarkerPalette);
33
markerChart.container(stage);
34
markerChart.draw();
35
36
var customTitle = anychart.standalones.title();
37
customTitle.text("Get and use chart marker palette.");
38
customTitle.container(stage);
39
customTitle.draw();
40
});