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.scatter([
3
{x: 1, value: 6},
4
{x: 1, value: 10},
5
{x: 2, value: 18},
6
{x: 3, value: 11},
7
{x: 3.1, value: 10},
8
{x: 3.1, value: 12},
9
{x: 4, value: 9},
10
{x: 2, value: 5},
11
{x: 4.5, value: 7},
12
{x: 2.1, value: 8}
13
]);
14
15
// Get chart xGrid.
16
var xGrid = chart.xGrid();
17
xGrid.stroke('#F44336');
18
19
chart.title('Get and modify chart xGrid');
20
chart.container('container');
21
chart.draw();
22
});