vue-chartjs - 如何始终显示工具提示?我正在使用 vue-chartjs v3.4
问题描述
我需要始终显示工具提示
我尝试 了如何始终在 Chart.js 上显示工具提示 2 我想在饼图中显示标签的值。(vue-chartjs/pieceLabel) 等。
import { Line } from 'vue-chartjs'
export default {
extends: Line,
props: {
linechartData: {
type: Array | Object,
required: true
},
linechartLabels: {
type: Array,
required: true
}
},
data () {
return {
options: {
title: {
display: true,
text: 'MONTHLY FEEDBACKS RECEIVED (LAST 12 MONTHS)'
},
scales: {
yAxes: [{
ticks: {
beginAtZero: true
},
gridLines: {
display: true
}
}],
xAxes: [{
gridLines: {
display: true
},
display: false
}]
},
legend: {
display: false
},
responsive: true,
maintainAspectRatio: false
}
}
},
mounted () {
this.renderChart({
labels: this.linechartLabels,
datasets: [{
borderColor: '#027be3',
pointBackgroundColor: 'rgb(38, 166, 154, 0.5)',
borderWidth: 1,
pointBorderColor: '#249EBF',
backgroundColor: 'rgb(38, 166, 154, 0.5)',
data: this.linechartData
}]
}, this.options)
}
}
我希望工具提示始终默认显示
解决方案
推荐阅读
- excel - 将表格行设置为范围
- scala - 如何使用 scalameta 解析和转换 sbt 项目中的所有源代码文件?
- laravel - 数据未提交到 db laravel:5.8
- rest - Rest:用于提取相似数据的 url 端点
- python - Python face_recognition 处理每一帧耗时太长
- sql - 无法对值进行分组
- python - 有人可以建议如何实现自定义 Django PasswordResetView?
- python - Tensorflow - 时间卷积网络不学习
- git - 如何使用 git checkout 恢复修改过的文件?
- bash - ffmpeg - 如何并行转换大量文件?