我尝试从画布上使用chart.js插件和fillrect方法,但没有任何效果。我想知道是否可以在图表中绘制矩形。
var ctx = document.getElementById('container');
var scatterChart = new Chart(ctx, {
type: 'scatter',
data: {
datasets: [{
label: 'Scatter Dataset',
data: [{
x: -10,
y: 0
}, {
x: 0,
y: 10
}, {
x: 10,
y: 5
}]
}]
},
options: {
scales: {
xAxes: [{
type: 'linear',
position: 'bottom'
}]
}
},
});