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 dataSet = anychart.data.set([
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}
12
]);
13
14
var pyramidChart = anychart.pyramid(dataSet);
15
pyramidChart.bounds(0, 0, "50%", "100%");
16
pyramidChart.selectHatchFill("diagonalBrick", "#E0E0E0", 0.4, 25);
17
pyramidChart.container(stage);
18
pyramidChart.draw();
19
20
var pieChart = anychart.pie([7, 7, 7, 7, 7, 7, 7]);
21
pieChart.hatchFill(true);
22
pieChart.bounds("50%", 0, "50%", "100%");
23
24
// Get hatch fill in selected state.
25
var pyramidChartSelectHatchFill = pyramidChart.selectHatchFill();
26
27
pieChart.hatchFill(pyramidChartSelectHatchFill);
28
pieChart.container(stage);
29
pieChart.draw();
30
31
var customTitle = anychart.standalones.title();
32
customTitle.text("Get and use chart selectHatchFill.");
33
customTitle.container(stage);
34
customTitle.draw();
35
});