我正在尝试在 Char JS 3.3.2 上使用自定义插入符号和位置构建条形图。
我刚刚在插件中添加了 beforeDraw 回调,但它从未被调用过。
plugins: {
beforeDraw: () => {
console.log('before Draw!!!!');
},
legend: {
display: false
},
tooltip: {
intersect: false,
position: 'myCustomPosition',
xAlign: 'center',
yAlign: 'bottom',
callbacks: {
label: function(context) {
var label = 'value : '
if (context.parsed.y !== null) {
label += context.parsed.y;
}
return label;
},
title: function() {
return null;
}
}
}
}
任何人都可以帮助我得到这个问题的答案吗?