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 chart = anychart.surface(getData());
3
4
// Get yGrid.
5
var yGrid = chart.yGrid();
6
7
yGrid.stroke({color: '#458b00', thickness: 2, dash: '5 2 5'});
8
9
chart.yAxis({title: 'Y-axis'});
10
chart.xAxis(false).zAxis(false);
11
chart.title('Get and modify yGrid');
12
chart.container('container');
13
chart.draw();
14
});
15
16
function getData() {
17
return [
18
[-3, -3, -216],
19
[-3, -2, -125],
20
[-3, -1, -64],
21
[-3, 0, -27],
22
[-3, 1, -8],
23
[-3, 2, -1],
24
[-3, 3, 0],
25
[-2, -3, -125],
26
[-2, -2, -64],
27
[-2, -1, -27],
28
[-2, 0, -8],
29
[-2, 1, -1],
30
[-2, 2, 0],
31
[-2, 3, 1],
32
[-1, -3, -64],
33
[-1, -2, -27],
34
[-1, -1, -8],
35
[-1, 0, -1],
36
[-1, 1, 0],
37
[-1, 2, 1],
38
[-1, 3, 8],
39
[0, -3, -27],
40
[0, -2, -8],
41
[0, -1, -1],
42
[0, 0, 0],
43
[0, 1, 1],
44
[0, 2, 8],
45
[0, 3, 27],
46
[1, -3, -8],
47
[1, -2, -1],
48
[1, -1, 0],
49
[1, 0, 1],
50
[1, 1, 8],
51
[1, 2, 27],
52
[1, 3, 64],
53
[2, -3, -1],
54
[2, -2, 0],
55
[2, -1, 1],
56
[2, 0, 8],
57
[2, 1, 27],
58
[2, 2, 64],
59
[2, 3, 125],
60
[3, -3, 0],
61
[3, -2, 1],
62
[3, -1, 8],
63
[3, 0, 27],
64
[3, 1, 64],
65
[3, 2, 125],
66
[3, 3, 216]
67
]
68
}