1
我一直在嘗試將自定義工具提示放在直方圖上,而我的圖表容器是網格網格。帶dc.js和d3-tip的Gridster網格不起作用
D3-尖端片段
var pieTip = d3.tip()
.attr("class", "d3-tip")
.offset([-10, 0])
.html(function(d) {
return "<span style='color: #f0027f'>" + d.data.key + "</span> : " + numberFormat(d.value);
});
這個片段是用於渲染。
.renderlet(function(chart) {
chart.select("svg").call(barTip)
.selectAll(".bar")
.on("mouseover", barTip.show)
.on("mouseout", barTip.hide);
我無法使它工作。任何指針將不勝感激。 謝謝
哦,很酷。謝謝你的回答 - 我看不出你的代碼有什麼問題,但是'z-index'是一件值得記住的事情。 – Gordon
你能發表一個工作代碼的例子嗎? – Mugshep
我剛剛在模型的css中添加了一條規則: .model z-index:10001; } –