-2
我想这样做,图表值每秒增加1。我怎样才能做到这一点?我尝试设置一个计数器变量,然后每秒增加一次,但由于某种原因它不能动态工作。越来越多的图表值 - chart.js
var myChart = new Chart(ctx, {
type: 'line',
data: {
datasets: [{
label: 'Crash line',
data: [0, 1], //1 here needs to be increased so the graphs grows up
backgroundColor: [
'rgba(108, 170, 91, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)'
],
borderWidth: 1
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
});