Commit d7195f2424d433f8f19a2c460256f61d8c655924
1 parent
e1b1f69e
Exists in
master
Novo gráfico para as médias das avaliações.
Showing
1 changed file
with
187 additions
and
0 deletions
Show diff stats
Desenvolvimento/Codificacao/e-Selo/WebContent/static/js/chartMediaAvaliacao.js
0 → 100644
@@ -0,0 +1,187 @@ | @@ -0,0 +1,187 @@ | ||
1 | +$(document).ready(function() { | ||
2 | + var qntAvaliacoes = $("#qntAvaliacoes").text(); | ||
3 | + | ||
4 | + var canvas = document.getElementById('myChart'); | ||
5 | + | ||
6 | + //inicio 4 avaliações | ||
7 | + if(qntAvaliacoes == 4){ | ||
8 | + | ||
9 | + var data = { | ||
10 | + | ||
11 | + labels: ["0",$("#data1").text(), $("#data2").text(), $("#data3").text(), $("#data4").text()], | ||
12 | + datasets: [ | ||
13 | + { | ||
14 | + label: "Avaliações", | ||
15 | + fill: false, | ||
16 | + lineTension: 0.1, | ||
17 | + backgroundColor: "rgba(75,192,192,0.4)", | ||
18 | + borderColor: "rgba(75,192,192,1)", | ||
19 | + borderCapStyle: 'butt', | ||
20 | + borderDash: [], | ||
21 | + borderDashOffset: 0.0, | ||
22 | + borderJoinStyle: 'miter', | ||
23 | + pointBorderColor: "rgba(75,192,192,1)", | ||
24 | + pointBackgroundColor: "#fff", | ||
25 | + pointBorderWidth: 1, | ||
26 | + pointHoverRadius: 5, | ||
27 | + pointHoverBackgroundColor: "rgba(75,192,192,1)", | ||
28 | + pointHoverBorderColor: "rgba(220,220,220,1)", | ||
29 | + pointHoverBorderWidth: 2, | ||
30 | + pointRadius: 5, | ||
31 | + pointHitRadius: 10, | ||
32 | + data: [0,$("#nota1").text(), $("#nota2").text(),$("#nota3").text(),$("#nota4").text()], | ||
33 | + | ||
34 | + | ||
35 | + } | ||
36 | + ] | ||
37 | + }; | ||
38 | + | ||
39 | + var option = { | ||
40 | + | ||
41 | + showLines: true | ||
42 | + }; | ||
43 | + var myLineChart = Chart.Line(canvas,{ | ||
44 | + data:data, | ||
45 | + options:option | ||
46 | + }); | ||
47 | + | ||
48 | + } | ||
49 | + | ||
50 | + //fim 4 avaliações | ||
51 | + | ||
52 | + //inicio 3 avaliações | ||
53 | + if(qntAvaliacoes == 3){ | ||
54 | + | ||
55 | + var data = { | ||
56 | + | ||
57 | + labels: ["0",$("#data1").text(), $("#data2").text(), $("#data3").text()], | ||
58 | + datasets: [ | ||
59 | + { | ||
60 | + label: "Avaliações", | ||
61 | + fill: false, | ||
62 | + lineTension: 0.1, | ||
63 | + backgroundColor: "rgba(75,192,192,0.4)", | ||
64 | + borderColor: "rgba(75,192,192,1)", | ||
65 | + borderCapStyle: 'butt', | ||
66 | + borderDash: [], | ||
67 | + borderDashOffset: 0.0, | ||
68 | + borderJoinStyle: 'miter', | ||
69 | + pointBorderColor: "rgba(75,192,192,1)", | ||
70 | + pointBackgroundColor: "#fff", | ||
71 | + pointBorderWidth: 1, | ||
72 | + pointHoverRadius: 5, | ||
73 | + pointHoverBackgroundColor: "rgba(75,192,192,1)", | ||
74 | + pointHoverBorderColor: "rgba(220,220,220,1)", | ||
75 | + pointHoverBorderWidth: 2, | ||
76 | + pointRadius: 5, | ||
77 | + pointHitRadius: 10, | ||
78 | + data: [0,$("#nota1").text(), $("#nota2").text(),$("#nota3").text()], | ||
79 | + | ||
80 | + | ||
81 | + } | ||
82 | + ] | ||
83 | + }; | ||
84 | + | ||
85 | + var option = { | ||
86 | + showLines: true | ||
87 | + }; | ||
88 | + var myLineChart = Chart.Line(canvas,{ | ||
89 | + data:data, | ||
90 | + options:option | ||
91 | + }); | ||
92 | + } | ||
93 | + | ||
94 | + //Fim 3 avaliações | ||
95 | + | ||
96 | + //inicio 4 avaliações | ||
97 | + if(qntAvaliacoes == 2){ | ||
98 | + | ||
99 | + var data = { | ||
100 | + | ||
101 | + labels: ["0",$("#data1").text(), $("#data2").text()], | ||
102 | + datasets: [ | ||
103 | + { | ||
104 | + label: "Avaliações", | ||
105 | + fill: false, | ||
106 | + lineTension: 0.1, | ||
107 | + backgroundColor: "rgba(75,192,192,0.4)", | ||
108 | + borderColor: "rgba(75,192,192,1)", | ||
109 | + borderCapStyle: 'butt', | ||
110 | + borderDash: [], | ||
111 | + borderDashOffset: 0.0, | ||
112 | + borderJoinStyle: 'miter', | ||
113 | + pointBorderColor: "rgba(75,192,192,1)", | ||
114 | + pointBackgroundColor: "#fff", | ||
115 | + pointBorderWidth: 1, | ||
116 | + pointHoverRadius: 5, | ||
117 | + pointHoverBackgroundColor: "rgba(75,192,192,1)", | ||
118 | + pointHoverBorderColor: "rgba(220,220,220,1)", | ||
119 | + pointHoverBorderWidth: 2, | ||
120 | + pointRadius: 5, | ||
121 | + pointHitRadius: 10, | ||
122 | + data: [0,$("#nota1").text(), $("#nota2").text()], | ||
123 | + | ||
124 | + | ||
125 | + } | ||
126 | + ] | ||
127 | + }; | ||
128 | + | ||
129 | + var option = { | ||
130 | + showLines: true | ||
131 | + }; | ||
132 | + var myLineChart = Chart.Line(canvas,{ | ||
133 | + data:data, | ||
134 | + options:option | ||
135 | + }); | ||
136 | + | ||
137 | + } | ||
138 | + | ||
139 | + //fim 2 avaliações | ||
140 | + | ||
141 | + //inicio 4 avaliações | ||
142 | + if(qntAvaliacoes == 1){ | ||
143 | + | ||
144 | + var data = { | ||
145 | + | ||
146 | + labels: ["0",$("#data1").text()], | ||
147 | + datasets: [ | ||
148 | + { | ||
149 | + label: "Avaliações", | ||
150 | + fill: false, | ||
151 | + lineTension: 0.1, | ||
152 | + backgroundColor: "rgba(75,192,192,0.4)", | ||
153 | + borderColor: "rgba(75,192,192,1)", | ||
154 | + borderCapStyle: 'butt', | ||
155 | + borderDash: [], | ||
156 | + borderDashOffset: 0.0, | ||
157 | + borderJoinStyle: 'miter', | ||
158 | + pointBorderColor: "rgba(75,192,192,1)", | ||
159 | + pointBackgroundColor: "#fff", | ||
160 | + pointBorderWidth: 1, | ||
161 | + pointHoverRadius: 5, | ||
162 | + pointHoverBackgroundColor: "rgba(75,192,192,1)", | ||
163 | + pointHoverBorderColor: "rgba(220,220,220,1)", | ||
164 | + pointHoverBorderWidth: 2, | ||
165 | + pointRadius: 5, | ||
166 | + pointHitRadius: 10, | ||
167 | + data: [0,$("#nota1").text()], | ||
168 | + | ||
169 | + | ||
170 | + } | ||
171 | + ] | ||
172 | + }; | ||
173 | + | ||
174 | + var option = { | ||
175 | + showLines: true | ||
176 | + }; | ||
177 | + var myLineChart = Chart.Line(canvas,{ | ||
178 | + data:data, | ||
179 | + options:option | ||
180 | + }); | ||
181 | + | ||
182 | + } | ||
183 | + | ||
184 | + //fim 1 avaliações | ||
185 | + | ||
186 | + | ||
187 | +}); | ||
0 | \ No newline at end of file | 188 | \ No newline at end of file |