this.myBarChart = new Chart('myBarChart', {
type: 'bar',
data: {
labels: ["Voice Control Mode", "Manual Mode", "Automatic Mode","Single Drive Mode","Dual Drive Mode"],
datasets: [
{
type: 'bar',
label: "Recordings",
backgroundColor: "rgba(2,117,216,1)",
borderColor: "rgba(2,117,216,1)",
data: [this.data.voicecontrolmode, this.data.manualmode, this.data.automaticmode,this.data.singledrivemode,this.data.dualdrivemode],
order:2
},
{
type: 'line',
data: [this.data.totalrecordings, this.data.totalrecordings, this.data.totalrecordings,this.data.totalrecordings,this.data.totalrecordings],
label: 'Total Recordings',
backgroundColor: "rgba(150,29,255,1)",
borderColor: "rgba(150,29,255,1)",
pointRadius:0,
pointHoverRadius:0,
order:1
}
]
},
options: {
// plugins:,
scales: {
xAxis: {
ticks: {
maxTicksLimit: 6
}
},
yAxis: {
ticks: {
maxTicksLimit: 5
}
}
}
}
});
我想删除标签:["语音控制模式"、"手动模式"、"自动模式"、"单驱模式"、"双驱模式"]仅用于折线图,以便总录制数只是一条直线,但当我将鼠标悬停在上面时,它应该只显示-总录制数:95(示例).对于条形图,标签仍应显示.enter image description here