HTMLcopy
1
<div id="container"></div>
CSScopy
8
1
html,
2
body,
3
#container {
4
width: 120%;
5
height: 100%;
6
margin: 0;
7
padding: 0;
8
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
// our data from bulbapedia
3
var data1 = [
4
{x: 'MTB WCL-IgG1 *', value: 3.5},
5
{x: 'MTB WCL-IgG2 ', value: -0.64},
6
{x: 'MTB WCL-IgG3 ', value: 0.57},
7
{x: 'MTB WCL-IgG4 ', value: 0.06},
8
9
];
10
var data2 = [
11
{x: 'MTB WCL-IgG1 *', value: 0.22},
12
{x: 'MTB WCL-IgG2 ', value: 0.23},
13
{x: 'MTB WCL-IgG3 ', value: 0.22},
14
{x: 'MTB WCL-IgG4 ', value: 0.33},
15
];
16
var data3 = [
17
{x: 'MTB WCL-IgG1 *', value: 0.1},
18
{x: 'MTB WCL-IgG2 ', value: -0.16},
19
{x: 'MTB WCL-IgG3 ', value: -0.13},
20
{x: 'MTB WCL-IgG4 ', value: -0.08},
21
];
22
var data4 = [
23
{x: 'MTB WCL-IgG1 *', value: 0.1},
24
{x: 'MTB WCL-IgG2 ', value: 0.1},
25
{x: 'MTB WCL-IgG3 ', value: 0.1},
26
{x: 'MTB WCL-IgG4 ', value: 0.1},
27
];
28
// create radar chart
29
var chart = anychart.radar();
30
31
chart.yScale().minimum(-1);
32
chart.yScale().maximum(5);
33
34
35
36
// configure the appearance of the y-axis
37
chart.yAxis().stroke({
38
color: "gray",
39
thickness: 1,
40
dash: "10 5"
41
});
42
43
// configure the appearance of the X-axis
44
chart.xAxis().stroke({
45
color: "#00cc99",
46
thickness: 2,
47
});
48
49
// color alternating cells
50
chart.yGrid().palette(['gray 0.01',0.01]);
51
52
// create first series (line) and set the data
53
chart.area(data1).name('ID MTBVAC Wk8 ').markers(true).fill('red', 0.1).stroke('0.8 red');
54
// create second series
55
chart.area(data2).name('ID MTBVAC Wk20').markers(true).fill('orange', 0.3).stroke('orange');
56
// create second series
57
chart.area(data3).name('ID BCG Wk8').markers(true).fill('green', 0.1).stroke('0.5 green');
58
// create second series
59
chart.area(data4).name('ID BCG Wk20').markers(true).fill('yellow', 0.3).stroke('yellow');
60
61
// set chart title
62
chart.title('MTB WCL-specific IgG subclass Fold Change post-vaccination')
63
// set legend
64
.legend(true);
65
// set container id for the chart
66
chart.container('container');
67
// initiate chart drawing
68
chart.draw();
69
});