我正在使用 chart.js 来显示折线图。如何隐藏 chart.js 折线图的工具提示标签?工具提示中的标签显示 undefined
所以我想隐藏标签(请看截图)?
也许有一种方法可以修改工具提示,我可以在工具提示中仅显示图例值?我的代码如下:
myLine = new Chart(ctx).Line(lineChartData, {
type: 'line',
responsive: true,
scaleShowGridLines : false,
bezierCurve : false,
animationEasing: "linear",
tooltipEvents: ["mousemove", "touchstart", "touchmove"],
showTooltips: true,
scaleLineColor: "rgba(0,0,0,.8)",
});
最佳答案
只需在您的选项中将 tooltipTitleFontSize
设置为 0
。
预览
脚本
myLine = new Chart(ctx).Line(lineChartData, {
...
tooltipTitleFontSize: 0
});
关于chart.js - 我想在工具提示中隐藏标签,因为它显示未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35431733/