質問編集履歴
2
</tbody>追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -224,6 +224,8 @@
|
|
224
224
|
|
225
225
|
</tr>
|
226
226
|
|
227
|
+
</tbody>
|
228
|
+
|
227
229
|
<input type="button" onclick="plotRadar()" value="完了">
|
228
230
|
|
229
231
|
</form>
|
1
code添付
test
CHANGED
File without changes
|
test
CHANGED
@@ -106,12 +106,228 @@
|
|
106
106
|
|
107
107
|
【できていないこと】
|
108
108
|
|
109
|
-
|
109
|
+
各値をformでwebブラウザから入力したのちに、radar chartを描画することができません。
|
110
|
+
|
110
|
-
|
111
|
+
radar chartの枠のみ表示されて、入力したデータが反映されていません。
|
112
|
+
|
113
|
+
```html
|
114
|
+
|
115
|
+
<html lang="ja">
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<head>
|
120
|
+
|
121
|
+
<meta charset="utf-8">
|
122
|
+
|
123
|
+
</head>
|
124
|
+
|
125
|
+
<body>
|
126
|
+
|
127
|
+
<form enctype="multipart/form-data">
|
128
|
+
|
129
|
+
<tbody id="tableData">
|
130
|
+
|
131
|
+
<tr>
|
132
|
+
|
133
|
+
<td>
|
134
|
+
|
135
|
+
HP
|
136
|
+
|
137
|
+
</td>
|
138
|
+
|
139
|
+
<td>
|
140
|
+
|
141
|
+
<input type="number" class="form-control" id="HP" placeholder="">
|
142
|
+
|
143
|
+
</td>
|
144
|
+
|
145
|
+
</tr>
|
146
|
+
|
147
|
+
<tr>
|
148
|
+
|
149
|
+
<td>
|
150
|
+
|
151
|
+
こうげき
|
152
|
+
|
153
|
+
</td>
|
154
|
+
|
155
|
+
<td>
|
156
|
+
|
157
|
+
<input type="number" class="form-control" id="kougeki" placeholder="">
|
158
|
+
|
159
|
+
</td>
|
160
|
+
|
161
|
+
</tr>
|
162
|
+
|
163
|
+
<tr>
|
164
|
+
|
165
|
+
<td>
|
166
|
+
|
167
|
+
ぼうぎょ
|
168
|
+
|
169
|
+
</td>
|
170
|
+
|
171
|
+
<td>
|
172
|
+
|
173
|
+
<input type="number" class="form-control" id="bougyo" placeholder="">
|
174
|
+
|
175
|
+
</td>
|
176
|
+
|
177
|
+
</tr>
|
178
|
+
|
179
|
+
<tr>
|
180
|
+
|
181
|
+
<td>
|
182
|
+
|
183
|
+
とくこう
|
184
|
+
|
185
|
+
</td>
|
186
|
+
|
187
|
+
<td>
|
188
|
+
|
189
|
+
<input type="number" class="form-control" id="tokukou" placeholder="">
|
190
|
+
|
191
|
+
</td>
|
192
|
+
|
193
|
+
</tr>
|
194
|
+
|
195
|
+
<tr>
|
196
|
+
|
197
|
+
<td>
|
198
|
+
|
199
|
+
とくぼう
|
200
|
+
|
201
|
+
</td>
|
202
|
+
|
203
|
+
<td>
|
204
|
+
|
205
|
+
<input type="number" class="form-control" id="tokubou" placeholder="">
|
206
|
+
|
207
|
+
</td>
|
208
|
+
|
209
|
+
</tr>
|
210
|
+
|
211
|
+
<tr>
|
212
|
+
|
213
|
+
<td>
|
214
|
+
|
215
|
+
すばやさ
|
216
|
+
|
217
|
+
</td>
|
218
|
+
|
219
|
+
<td>
|
220
|
+
|
221
|
+
<input type="number" class="form-control" id="subayasa" placeholder="">
|
222
|
+
|
223
|
+
</td>
|
224
|
+
|
225
|
+
</tr>
|
226
|
+
|
227
|
+
<input type="button" onclick="plotRadar()" value="完了">
|
228
|
+
|
229
|
+
</form>
|
230
|
+
|
231
|
+
<canvas id="myRaderChart"></canvas>
|
232
|
+
|
233
|
+
<!-- CDN -->
|
234
|
+
|
111
|
-
https://s
|
235
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.bundle.js"></script>
|
236
|
+
|
237
|
+
|
238
|
+
|
112
|
-
|
239
|
+
<script>
|
240
|
+
|
241
|
+
function plotRadar(){
|
242
|
+
|
243
|
+
var HP = document.getElementById('HP');
|
244
|
+
|
245
|
+
var kougeki = document.getElementById('kougeki');
|
246
|
+
|
247
|
+
var bougyo = document.getElementById('bougyo');
|
248
|
+
|
249
|
+
var tokukou = document.getElementById('tokukou');
|
250
|
+
|
251
|
+
var tokubou = document.getElementById('tokubou');
|
252
|
+
|
113
|
-
|
253
|
+
var subayasa = document.getElementById('subayasa');
|
254
|
+
|
255
|
+
|
256
|
+
|
114
|
-
|
257
|
+
var ctx = document.getElementById("myRaderChart");
|
258
|
+
|
259
|
+
|
260
|
+
|
115
|
-
|
261
|
+
var myRadarChart = new Chart(ctx, {
|
262
|
+
|
116
|
-
|
263
|
+
type: 'radar',
|
264
|
+
|
265
|
+
data: {
|
266
|
+
|
267
|
+
labels: ["HP", "こうげき", "ぼうぎょ", "とくこう", "とくぼう", "すばやさ"],
|
268
|
+
|
269
|
+
datasets: [{
|
270
|
+
|
271
|
+
label: 'ピカチュウ',
|
272
|
+
|
273
|
+
data: [HP, kougeki, bougyo, tokukou, tokubou, subayasa],
|
274
|
+
|
275
|
+
backgroundColor: 'RGBA(255,255,0, 0.5)',
|
276
|
+
|
277
|
+
borderColor: 'RGBA(165,42,42, 1)',
|
278
|
+
|
279
|
+
borderWidth: 1,
|
280
|
+
|
281
|
+
pointBackgroundColor: 'RGB(165,42,42)'
|
282
|
+
|
283
|
+
}]
|
284
|
+
|
285
|
+
},
|
286
|
+
|
287
|
+
options: {
|
288
|
+
|
289
|
+
title: {
|
290
|
+
|
291
|
+
display: true,
|
292
|
+
|
293
|
+
text: '努力値'
|
294
|
+
|
295
|
+
},
|
296
|
+
|
297
|
+
scale:{
|
298
|
+
|
299
|
+
ticks:{
|
300
|
+
|
301
|
+
suggestedMin: 0,
|
302
|
+
|
303
|
+
suggestedMax: 252,
|
304
|
+
|
305
|
+
stepSize: 50,
|
306
|
+
|
307
|
+
callback: function(value, index, values){
|
308
|
+
|
309
|
+
return value
|
310
|
+
|
311
|
+
}
|
312
|
+
|
313
|
+
}
|
314
|
+
|
315
|
+
}
|
316
|
+
|
317
|
+
}
|
318
|
+
|
319
|
+
});
|
320
|
+
|
321
|
+
};
|
322
|
+
|
323
|
+
</script>
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
</body>
|
328
|
+
|
329
|
+
```
|
330
|
+
|
331
|
+
|
332
|
+
|
117
|
-
どう
|
333
|
+
どうすればよろしいでしょうか?
|