HTMLcopy
1
<div id="container"></div>
CSScopy
8
1
html,
2
body,
3
#container {
4
width: 100%;
5
height: 100%;
6
margin: 0;
7
padding: 0;
8
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
var dataSet = anychart.data.set(getData());
3
4
// map data for the first series, take x from the zero column and value from the first column of data set
5
var firstSeriesData = dataSet.mapAs({ x: 0, value: 1 });
6
7
// map data for the second series, take x from the second column and value from the third column of data set
8
var secondSeriesData = dataSet.mapAs({ x: 2, value: 3 });
9
10
// map data for the second series, take x from the fourth column and value from the fifth column of data set
11
var thirdSeriesData = dataSet.mapAs({ x: 4, value: 5 });
12
13
// create polar chart
14
var chart = anychart.polar();
15
16
// set chart yScale settings
17
chart.yScale().minimum(0).maximum(16);
18
chart.yScale().ticks().interval(2);
19
20
// set chart xScale settings
21
chart.xScale().maximum(360);
22
chart.xScale().ticks().interval(30);
23
24
// set xAxis formatting settings
25
chart.xAxis().labels().format('{%Value}\xb0');
26
27
// set chart legend settings
28
chart.legend().enabled(true).align('center');
29
30
var series1 = chart.marker(firstSeriesData);
31
series1.name('Signal A');
32
33
var series2 = chart.marker(secondSeriesData);
34
series2.name('Signal B');
35
36
var series3 = chart.marker(thirdSeriesData);
37
series3.name('Signal C');
38
39
// set container id for the chart
40
chart.container('container');
41
// initiate chart drawing
42
chart.draw();
43
});
44
45
function getData() {
46
return [
47
[15, 9, 14.29, 10.7, 8.589, 13.44],
48
[30, 7, 42.96, 8.75, 10.59, 9.12],
49
[45, 10, 57.64, 8.82, 54.26, 6.15],
50
[60, 7, 57.7, 9.83, 66.81, 8.23],
51
[75, 8, 54.94, 11.1, 19.95, 7.7],
52
[90, 7, 26.39, 4.91, 23.21, 5.36],
53
[105, 9, 49.62, 11.81, 9.49, 13.19],
54
[120, 3, 87.82, 6.82, 98.62, 7.02],
55
[135, 6, 81.56, 7.71, 35.13, 9.22],
56
[150, 2, 44.62, 5.18, 62.21, 4.61],
57
[165, 5, 107.54, 4.75, 161.42, 7.75],
58
[180, 6, 43.88, 10.07, 153.18, 5.65],
59
[195, 3, 56.48, 6.11, 153.08, 5.42],
60
[210, 6, 123.22, 7.16, 127.81, 9.73],
61
[225, 6, 144.81, 6.54, 120.58, 5.02],
62
[240, 6, 129.37, 10.22, 91.01, 8.48],
63
[255, 5, 158.61, 6.11, 90.15, 6.5],
64
[270, 4, 74.77, 6.74, 5.8, 7.53],
65
[285, 10, 19.45, 14.41, 144.32, 6.37],
66
[300, 4, 156.2, 6.7, 284.68, 6.01],
67
[315, 8, 220.43, 12.49, 34.43, 11.25],
68
[330, 5, 124.03, 8.41, 120.56, 4.62],
69
[345, 6, 47.04, 10.24, 131.05, 9.04],
70
[360, 3, 3.5, 6.99, 3.5, 5.47]
71
];
72
}