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 data
4
var data = [
5
["Strength", 8],
6
["Dexterity", 14],
7
["Concentration", 14],
8
["Intelligence", 15],
9
["Wisdom", 12],
10
["Charisma", 8]
11
];
12
13
// create a chart
14
var chart = anychart.polar();
15
16
// create a polygon series and set the data
17
var series = chart.polygon(data);
18
19
// set the type of the x-scale
20
chart.xScale("ordinal");
21
22
// enable sorting points by x
23
chart.sortPointsByX(true);
24
25
// set the inner radius
26
chart.innerRadius(50);
27
28
// set the chart title
29
chart.title("Polygon Chart: Basic Sample");
30
31
// set the container id
32
chart.container("container");
33
34
// initiate drawing the chart
35
chart.draw();
36
});