我正在像这样构建我的数据项:
data.push({ x: moment(new Date(e.StartDate)).week(), y: e.title, label:`${e.title} ${e.type} ${e.percentage}%` });
如何编写自定义工具提示回调来显示标签字符串?
Chart.js 文档显示了自定义工具提示的完整描述:
http://www.chartjs.org/docs/latest/configuration/tooltip.html#external-custom-tooltips
还有例子:
http://www.chartjs.org/samples/latest/tooltips/custom-line.html
http://www.chartjs.org/samples/latest/tooltips/custom-pie.html
http://www.chartjs.org/samples/latest/tooltips/custom-points.html