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
// create data set on our data
3
var dataSet = anychart.data.set([
4
['C- MEJORAN RELACIONES EN LA ESCUELA Y EL HOGAR', 79, 73, 41.67, 66.66, 75],
5
['C- ACTITUDES Y VALORES PARA COMPARTIR', 68, 33, 66.67, 66.66, 100],
6
['C- GOZAN DE APRENDER Y ENSEÑAR',45, 33, 33, 33, 50],
7
['A - INVESTIGAN POR CUENTA PROPIA', 62, 60, 33, 50, 88],
8
['A - PROCEDEN A SU PASO Y MODO', 39, 46, 25, 16, 75],
9
['A- ELIGEN TEMAS DE ESTUDIO', 34, 53, 33, 16, 50],
10
['HS- ADQUIEREN SEGURIDAD', 59, 60, 41, 66, 50],
11
['HS- CRÍTICOS DEL SISTEMA', 49, 33, 58, 50, 63],
12
['HS- DECIDEN SU PROYECTO DE VIDA', 35, 53, 16, 16, 12],
13
['HC- HABLAR CON SEGURIDAD', 62, 46, 16, 83, 75],
14
['HC- APRENDEN A PROFUNDIDAD', 45, 26, 41, 33, 75],
15
['HC- INDAGAR MÁS ES NECESIDAD', 31, 26, 0, 33, 50],
16
17
18
]);
19
20
21
// map data for the first series, take x from the zero column and value from the first column of data set
22
var data1 = dataSet.mapAs({'x': 0, 'value': 1});
23
// map data for the second series, take x from the zero column and value from the second column of data set
24
var data2 = dataSet.mapAs({'x': 0, 'value': 2});
25
// map data for the third series, take x from the zero column and value from the third column of data set
26
var data3 = dataSet.mapAs({'x': 0, 'value': 3});
27
// map data for the first series, take x from the zero column and value from the first column of data set
28
var data4 = dataSet.mapAs({'x': 0, 'value': 4});
29
// map data for the second series, take x from the zero column and value from the second column of data set
30
var data5 = dataSet.mapAs({'x': 0, 'value': 5});
31
32
33
34
// create radar chart
35
var chart = anychart.radar();
36
37
// set chart title text settings
38
chart.title('RADAR COMPARATIVO')
39
// set chart legend
40
.legend(true);
41
42
// set chart padding settings
43
chart.padding().bottom(70);
44
45
// set chart yScale settings
46
chart.yScale()
47
.minimum(0)
48
.maximum(100)
49
.ticks({'interval': 10});
50
51
// create chart label with description
52
chart.label()
53
.text('Este cuadro muestra un comparativo con los rasgos más recurrentes encontrados en el análisis de datos'
54
)
55
.anchor('center-bottom')
56
.position('center-bottom')
57
.fontWeight('normal')
58
.fontSize(11)
59
.fontFamily('tahoma')
60
.fontColor('black')
61
.offsetY(15);
62
63
// create first series with mapped data
64
chart.line(data1).name('EXALUMNOS').markers(true).stroke("#AB91C5");
65
// create second series with mapped data
66
chart.line(data2).name('ALUMNOS').markers(true).stroke("#a22a86");
67
// create third series with mapped data
68
chart.line(data3).name('MAESTROS').markers(true);
69
// create third series with mapped data
70
chart.line(data4).name('PADRES').markers(true);
71
// create third series with mapped data
72
chart.line(data5).name('CONAFE').markers(true);
73
74
// set tooltip format
75
chart.tooltip().format('Porcentaje: {%Value}{decimalsCount: 2}');
76
77
// set container id for the chart
78
chart.container('container');
79
// initiate chart drawing
80
chart.draw();
81
82
83
84
});