[英]Is there a way to display a chart label that has no data behind it in Chart.js
[英]Is there a way to display legend's data over the chart in chart.js?
我使用 chart.js 和 react-chartjs-2 庫創建了一個餅圖,但我想知道是否有一種方法可以在圖表組件上顯示數據,而不是在將鼠標懸停在餅圖的每個區域時作為工具提示
我想做的是顯示與每個區域相關的數據,就像在它上面一樣。
創建新圖表時可以添加選項
var pieChart = new Chart(canvas, {
type: "pie",
data: data,
options: {
legend: {
display: true,
position : 'top'
},
tooltips: {
enabled: false
}
}
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.