如何隐藏顶部的数据标签并绘制一条线性线(在背景中)
x = 0
使用与数据集不同的颜色(以红色水平线显示)
new Chart(canvas_id, {
type: 'line',
data: {
datasets: [{
data: dates,
borderWidth: 2
}],
//labels: ['a', 'b']
},
options: {
responsive: true,
maintainAspectRatio: false,
elements: {
point: {
radius: 0
}
},
plugins: {
tooltip: {
enabled: false
}
}
}
});
In options legend : false
options: {
legend: {
display: false
}
}