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
// create data
7
var data = [
8
{x: 0, value: 500},
9
{x: 180, value: 200}
10
];
11
12
// set the position and data for the first chart
13
var polar1 = anychart.polar();
14
polar1.title("Cell Color: Radial Grid");
15
polar1.bounds(0, 0, "50%", "100%");
16
// create a line series
17
polar1.line(data);
18
// color the even-odd cells of the x-grid
19
polar1.xGrid().palette(["gray 0.05", "gray 0.1"]);
20
21
// set the maximum value of the x-scale
22
polar1.xScale().maximum(360);
23
// set the chart container
24
polar1.container(stage);
25
// initiate drawing the chart
26
polar1.draw();
27
28
// set the position and data for the second chart
29
var polar2 = anychart.polar();
30
polar2.title("Cell Color: Circular Grid");
31
polar2.bounds("50%", 0, "50%", "100%");
32
// create a line series
33
polar2.line(data);
34
// color the even-odd cells of the y-grid
35
polar2.yGrid().palette(["gray 0.05", "gray 0.1"]);
36
37
// set the maximum value of the x-scale
38
polar2.xScale().maximum(360);
39
// set the chart container
40
polar2.container(stage);
41
// initiate drawing the chart
42
polar2.draw();
43
});