ngOnInit(): void {
var myChart = new Chart('myChart', {
type: 'bar',
data: {
labels: ['Recordings'],
datasets: [
{
label: 'A',
data: [this.data.a],
borderColor: 'rgba(255,105,180,1)',
backgroundColor: 'rgba(255,105,180,0.2)',
barPercentage:0.4,
borderWidth:2,
order: 1
},
{
label: 'B',
data: [this.data.b],
borderColor: 'rgba(75, 192, 192, 1)',
backgroundColor: 'rgba(75, 192, 192, 0.2)',
barPercentage:0.4,
borderWidth:2,
order: 2
},
{
label: 'Total Recordings',
data:[this.data.totalrecordings],
type:'line',
borderColor:'rgba(2,117,216,1)',
backgroundColor:'rgba(2,117,216,0.2)',
order:0
}
]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'top',
}
}
},
})
}
我希望总记录折线图应该是一条水平直线,当我将鼠标悬停在该直线上时,它应该显示总记录值。现在,该图正在绘制,如图所示。
1条答案
按热度按时间2w2cym1i1#
我终于找到了出路。答案是一个漂浮的酒吧
此外,要在悬停时正确显示总记录数据,请使用此