如果鼠标在数据“白色”上方,我的工具提示应隐藏..但我不知道该怎么做
这是我的代码:
state.selectAll("rect")
.data(function(d) { return d.ages; })
.enter().append("rect")
.attr("width", x.rangeBand())
.attr("y", function(d) { return y(d.y1); })
.attr("height", function(d) { return y(d.y0) - y(d.y1); })
.style("fill", function(d) { return color(d.name); })
.call(d3.helper.tooltip()
.attr({class: 'tooltip2'})
.text(function(d, i){ return d.name + ': '+ (-((d.y0) - (d.y1))) ; })
);
dataseries:
State, White , FA Nicht gebucht, FA gebucht
07.10.2014,24,1,0
08.10.2014,24,1,0
13.10.2014,22,3,0
14.10.2014,24,1,0
15.10.2014,21,4,0
16.10.2014,15,10,1
17.10.2014,12,13,0
20.10.2014,17,8,0