我正在爲我的項目使用NVD3庫,並且我已經編寫了以下代碼。NVD3 TooltipContent不起作用
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";
});
預期的輸出應該是在鼠標顯示打招呼。 但我不明白,而是我得到了默認的工具提示。
請讓我知道我正在做的錯誤。
[nvd3餅圖的可能重複。 js - 如何編輯工具提示?](http://stackoverflow.com/questions/12416508/nvd3-piechart-js-how-to-edit-the-t ooltip) – shabeer90 2014-10-20 11:09:49
我現在把它弄了.useInteractiveGuideline(true)是不正確的。它應該是.useInteractiveGuideline(false)。由於定製工具提示不能與用戶2612936建議的「useInteractiveGuideline」一起存在,請訪問http://stackoverflow.com/questions/12416508/nvd3-piechart-js-how-to-edit-the-tooltip – 2014-10-21 08:08:55
感謝shabeer90引導到正確的帖子。 – 2014-10-21 08:09:44