Rav*_*nth 2 linechart chart.js
我正在使用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)",
});
Run Code Online (Sandbox Code Playgroud)
只需设置tooltipTitleFontSize
到0
在你的选择.
预习
脚本
myLine = new Chart(ctx).Line(lineChartData, {
...
tooltipTitleFontSize: 0
});
Run Code Online (Sandbox Code Playgroud)