var dmgchartt = document.getElementById("dmgchart");
new Chart(dmgchartt, {
type: "radar",
data: radarChartData0,
options: {
tooltipTemplate: "<%if (label){%><%=label %>: <%}%><%= value + ' %' %>",
scale: {
ticks: {
beginAtZero: true
}
},
title: {
display: true,
text: 'Title'
}
}
});
它只显示数值,没有百分号。我试图在tooltip上添加百分号以显示值,但没有成功。另外,我该如何选择tooltip是多行还是单行?我有两个数据集。
tooltipTemplate
是用于Chart.js 1.0的。在Chart.js 2.0中,你需要使用options.tooltips.callbacks.labels
。 - xnakos