【发布时间】:2014-12-14 16:06:48
【问题描述】:
我正在为我的项目使用 NVD3 库,并且我编写了以下代码。
var chart = nv.models.lineChart()
.useInteractiveGuideline(true)
.margin({top: 50, right: 50, bottom: 50, left: 50})
.tooltipContent(function (key, y, e, graph) {
console.log("helo");
return "hello";
});
预期的输出应该是在鼠标悬停时显示 hello。 但我不明白,而是我得到了默认的工具提示。
请让我知道我正在做的错误。
【问题讨论】:
-
我现在明白了 .useInteractiveGuideline(true) 行不正确。它应该是 .useInteractiveGuideline(false)。由于用户2612936在stackoverflow.com/questions/12416508/…上建议的“useInteractiveGuideline”不能存在自定义工具提示
-
感谢 shabeer90 指向正确的帖子。