質問編集履歴
2
情報の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,11 +14,15 @@
|
|
14
14
|
|
15
15
|
datasets:[{
|
16
16
|
|
17
|
+
label:"要素1",
|
18
|
+
|
17
19
|
data:[4,5,9,14,,24,30],
|
18
20
|
|
19
21
|
},
|
20
22
|
|
21
23
|
{
|
24
|
+
|
25
|
+
label:"要素2",
|
22
26
|
|
23
27
|
data:[,1.5,1.9,1.4,1.5,2,4,3.0],
|
24
28
|
|
1
情報の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -63,3 +63,89 @@
|
|
63
63
|
mode: 'index'を記述し、マウスホバー時に全ての要素を表示するよう設定したのですが、空白値の場合「NaN」が表示されてしまいます。
|
64
64
|
|
65
65
|
これを表示したくないのですが、どのようにしたら良いでしょうか?![イメージ説明](310f989ad3f6ef39b6e8912ae17c2c11.png)
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
```html
|
70
|
+
|
71
|
+
<script>
|
72
|
+
|
73
|
+
var ctx = document.getElementById("LineChart").getContext('2d');
|
74
|
+
|
75
|
+
var chart = new Chart(ctx, {
|
76
|
+
|
77
|
+
type: "bar",
|
78
|
+
|
79
|
+
data:{
|
80
|
+
|
81
|
+
labels:["1月","2月","3月","4月","5月","6月","7月"],
|
82
|
+
|
83
|
+
datasets:[{
|
84
|
+
|
85
|
+
data:[4,5,9,14,,24,30],
|
86
|
+
|
87
|
+
},
|
88
|
+
|
89
|
+
{
|
90
|
+
|
91
|
+
data:[,1.5,1.9,1.4,1.5,2,4,3.0],
|
92
|
+
|
93
|
+
}]
|
94
|
+
|
95
|
+
},
|
96
|
+
|
97
|
+
options:{
|
98
|
+
|
99
|
+
tooltips: {
|
100
|
+
|
101
|
+
mode: 'nearest',
|
102
|
+
|
103
|
+
intersect: false,
|
104
|
+
|
105
|
+
mode: 'index',
|
106
|
+
|
107
|
+
callbacks: {
|
108
|
+
|
109
|
+
label: item => item.value.replace('NaN', '')
|
110
|
+
|
111
|
+
}
|
112
|
+
|
113
|
+
},
|
114
|
+
|
115
|
+
scales:{
|
116
|
+
|
117
|
+
xAxes:[{
|
118
|
+
|
119
|
+
stacked: true
|
120
|
+
|
121
|
+
}],
|
122
|
+
|
123
|
+
yAxes:[{
|
124
|
+
|
125
|
+
stacked: true
|
126
|
+
|
127
|
+
}]
|
128
|
+
|
129
|
+
}
|
130
|
+
|
131
|
+
}
|
132
|
+
|
133
|
+
});
|
134
|
+
|
135
|
+
</script>
|
136
|
+
|
137
|
+
```
|
138
|
+
|
139
|
+
```html
|
140
|
+
|
141
|
+
<div style="width:100%; overflow-x:auto; overflow-y:visible">
|
142
|
+
|
143
|
+
<div class="linechart_container">
|
144
|
+
|
145
|
+
<canvas id='LineChart'></canvas>
|
146
|
+
|
147
|
+
</div>
|
148
|
+
|
149
|
+
</div>
|
150
|
+
|
151
|
+
```
|