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
3
// create a stage
4
var stage = anychart.graphics.create("container");
5
6
7
// create data
8
var data = [
9
{x: "A", value: 1222},
10
{x: "B", value: 2431},
11
{x: "C", value: 3624},
12
{x: "D", value: 5243},
13
{x: "E", value: 6813},
14
{x: "F", value: 5321},
15
{x: "G", value: 1567},
16
{x: "H", value: 3876}
17
];
18
19
// set the position and data for the first chart
20
var radar1 = anychart.radar(data);
21
radar1.title("Cell Color: Radial Grid");
22
radar1.bounds(0, 0, "50%", "100%");
23
// color the even-odd cells of the x-grid
24
radar1.xGrid().palette(["gray 0.05", "gray 0.1"]);
25
26
// set the chart container
27
radar1.container(stage);
28
// initiate drawing the chart
29
radar1.draw();
30
31
// set the position and data for the second chart
32
var radar2 = anychart.radar(data);
33
radar2.title("Cell Color: Circular Grid");
34
radar2.bounds("50%", 0, "50%", "100%");
35
// color the even-odd cells of the y-grid
36
radar2.yGrid().palette(["gray 0.05", "gray 0.1"]);
37
// set the chart container
38
radar2.container(stage);
39
// initiate drawing the chart
40
radar2.draw();
41
});