質問編集履歴
1
対応策を追記しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -111,3 +111,105 @@
|
|
111
111
|
Chart.js 2.9.3
|
112
112
|
|
113
113
|
Chrome 85.0.4183.102
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
### 対応策
|
118
|
+
|
119
|
+
```html
|
120
|
+
|
121
|
+
<script>
|
122
|
+
|
123
|
+
var ctx = document.getElementById('myChart').getContext('2d');
|
124
|
+
|
125
|
+
var myRadarChart = new Chart(ctx, {
|
126
|
+
|
127
|
+
type: 'radar',
|
128
|
+
|
129
|
+
data: {
|
130
|
+
|
131
|
+
labels: ['項目1', '項目2', '項目3', '項目4'],
|
132
|
+
|
133
|
+
datasets: [{
|
134
|
+
|
135
|
+
label: 'サンプル1',
|
136
|
+
|
137
|
+
backgroundColor: 'rgba(255, 0, 0, 0.1)',
|
138
|
+
|
139
|
+
borderColor: 'rgba(255, 0, 0, 0.3)',
|
140
|
+
|
141
|
+
data: [6, 8, 3, 8],
|
142
|
+
|
143
|
+
},
|
144
|
+
|
145
|
+
{
|
146
|
+
|
147
|
+
label: 'サンプル2',
|
148
|
+
|
149
|
+
backgroundColor: 'rgba(0, 0, 255, 0.1)',
|
150
|
+
|
151
|
+
borderColor: 'rgba(0, 0, 255, 0.3)',
|
152
|
+
|
153
|
+
data: [8, 4, 2, 4],
|
154
|
+
|
155
|
+
}]
|
156
|
+
|
157
|
+
},
|
158
|
+
|
159
|
+
options: {
|
160
|
+
|
161
|
+
responsive: false,
|
162
|
+
|
163
|
+
scale: {
|
164
|
+
|
165
|
+
angleLines: {
|
166
|
+
|
167
|
+
display: true,
|
168
|
+
|
169
|
+
},
|
170
|
+
|
171
|
+
ticks: {
|
172
|
+
|
173
|
+
suggestedMin:0,
|
174
|
+
|
175
|
+
suggestedMax: 10
|
176
|
+
|
177
|
+
}
|
178
|
+
|
179
|
+
},
|
180
|
+
|
181
|
+
tooltips : {
|
182
|
+
|
183
|
+
callbacks: {
|
184
|
+
|
185
|
+
title: function (tooltipItem, data){
|
186
|
+
|
187
|
+
const idx = tooltipItem[0].index;
|
188
|
+
|
189
|
+
const title = data.labels[idx];
|
190
|
+
|
191
|
+
return title;
|
192
|
+
|
193
|
+
},
|
194
|
+
|
195
|
+
label: function (tooltipItem, data){
|
196
|
+
|
197
|
+
const idx = tooltipItem.datasetIndex;
|
198
|
+
|
199
|
+
const label = data.datasets[idx].label;
|
200
|
+
|
201
|
+
return label + ':' + tooltipItem.value;
|
202
|
+
|
203
|
+
}
|
204
|
+
|
205
|
+
}
|
206
|
+
|
207
|
+
}
|
208
|
+
|
209
|
+
}
|
210
|
+
|
211
|
+
});
|
212
|
+
|
213
|
+
</script>
|
214
|
+
|
215
|
+
```
|