liprec / powerbi-d3jsvisual

Home of the code of my Power BI Custom Visual: D3JS Visual
MIT License
57 stars 20 forks source link

Adding tooltips to Circle - treelayout #3

Open ramiouanes opened 6 years ago

ramiouanes commented 6 years ago

Hello,

Thank you for this custom visual which helps a lot. I haven't been able to add a tooltip to nodes in treelayout. Is this a functionality that is supported by the visual?

Would appreciate your help with this.

PS: below is the code that I'm using from the example from this http://bl.ocks.org/d3noob/9692795

var div = d3.select("#Chart").append("div") .attr("class", "tooltip") .style("opacity", 0); var nodeEnter = node.enter().append("g") .attr("class", "node") .attr("transform", function (d) {return "translate(" + source.x0 + "," + source.y0 + ")";}) .on("click", click) .on("mouseover", function(d) { div.transition() .duration(200) .style("opacity", .9); div .html("testing: " + d.name + "<br/>" ) .style("left", (d3.event.pageX) + "px") .style("top", (d3.event.pageY - 28) + "px"); }) .on("mouseout", function(d) { div.transition() .duration(500) .style("opacity", 0); });

Regards,

liprec commented 6 years ago

Sorry for the late response, but the visual should be able to show the tooltips. Only as the visual is sandboxed in Power BI the tooltips cannot hover outside the border.

alexisc67 commented 6 years ago

Hi, Do you have an example of a tooltip working. I am using a similar sample as ramiouanes and the tooltips don't show. The same do show outside PowerBI. Many thanks in advance. Alexis

jasperchow5915 commented 4 years ago

I am having the same issue. Any solution to this? Thanks