|
134 | 134 | }, |
135 | 135 | scales: { |
136 | 136 | xAxes: [{ |
137 | | - type: 'realtime' |
| 137 | + type: 'realtime', |
| 138 | + realtime: { |
| 139 | + duration: 20000, |
| 140 | + ttl: 60000, |
| 141 | + refresh: 1000, |
| 142 | + delay: 2000, |
| 143 | + pause: false, |
| 144 | + onRefresh: onRefresh |
| 145 | + } |
138 | 146 | }], |
139 | 147 | yAxes: [{ |
140 | 148 | type: 'linear', |
|
155 | 163 | }, |
156 | 164 | plugins: { |
157 | 165 | streaming: { |
158 | | - duration: 20000, |
159 | | - ttl: 60000, |
160 | | - refresh: 1000, |
161 | | - delay: 2000, |
162 | | - frameRate: 30, |
163 | | - pause: false, |
164 | | - onRefresh: onRefresh |
| 166 | + frameRate: 30 |
165 | 167 | } |
166 | 168 | } |
167 | 169 | } |
|
210 | 212 | }); |
211 | 213 |
|
212 | 214 | document.getElementById('duration').addEventListener(isIE ? 'change' : 'input', function() { |
213 | | - config.options.plugins.streaming.duration = +this.value; |
| 215 | + config.options.scales.xAxes[0].realtime.duration = +this.value; |
214 | 216 | window.myChart.update({duration: 0}); |
215 | 217 | document.getElementById('durationValue').innerHTML = this.value; |
216 | 218 | }); |
217 | 219 |
|
218 | 220 | document.getElementById('ttl').addEventListener(isIE ? 'change' : 'input', function() { |
219 | | - config.options.plugins.streaming.ttl = +this.value; |
| 221 | + config.options.scales.xAxes[0].realtime.ttl = +this.value; |
220 | 222 | window.myChart.update({duration: 0}); |
221 | 223 | document.getElementById('ttlValue').innerHTML = this.value; |
222 | 224 | }); |
223 | 225 |
|
224 | 226 | document.getElementById('refresh').addEventListener(isIE ? 'change' : 'input', function() { |
225 | | - config.options.plugins.streaming.refresh = +this.value; |
| 227 | + config.options.scales.xAxes[0].realtime.refresh = +this.value; |
226 | 228 | window.myChart.update({duration: 0}); |
227 | 229 | document.getElementById('refreshValue').innerHTML = this.value; |
228 | 230 | }); |
229 | 231 |
|
230 | 232 | document.getElementById('delay').addEventListener(isIE ? 'change' : 'input', function() { |
231 | | - config.options.plugins.streaming.delay = +this.value; |
| 233 | + config.options.scales.xAxes[0].realtime.delay = +this.value; |
232 | 234 | window.myChart.update({duration: 0}); |
233 | 235 | document.getElementById('delayValue').innerHTML = this.value; |
234 | 236 | }); |
|
240 | 242 | }); |
241 | 243 |
|
242 | 244 | document.getElementById('pause').addEventListener('change', function() { |
243 | | - config.options.plugins.streaming.pause = this.checked; |
| 245 | + config.options.scales.xAxes[0].realtime.pause = this.checked; |
244 | 246 | window.myChart.update({duration: 0}); |
245 | 247 | document.getElementById('pauseValue').innerHTML = this.checked; |
246 | 248 | }); |
|
0 commit comments