0
最新のChart Jsを使用しています。私は常にグラフにラベルを表示する必要があります(マウスオーバーはありません)。出来ますか?はいの場合は、作業サンプルコードで私を助けてください。マウスオーバーなしでchartjsにラベルを表示する方法は?
ありがとうございます。
私の現在のChartjsコード:
var ctx = $("#myChart");
var label = ctx.data('clabel').split(',');
var val = ctx.data('cval').split(',');
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: label,
datasets: [{
label: 'Daily Capital',
data: val,
backgroundColor: [
'rgba(0, 153, 34, 0.5)',
],
borderColor: [
'rgba(0, 153, 34, 1);',
],
borderWidth: 2
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
legend: {
display: false,
},
animation: {
duration: 0, // general animation time
},
hover: {
animationDuration: 0,
},
responsiveAnimationDuration: 0, // animation duration after a resize
elements: {
line: {
tension: 0, // disables bezier curves
},
},
tooltips: {
callbacks: {
label: function(tooltipItem, data){
return '£' + tooltipItem.yLabel;
},
title: function(tooltipItem, data){
return '';
},
}
},
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
});
私は誰かが助けることができると思います。事前にありがとう