1

Hi stackoverflow community!

I'm new to d3 and I'm attempting to stand on the shoulders of giants to create a visualization.

I've gotten to a place that I'm happy with my Radial Tree but i'm having trouble adding tooltips. Is it possible in a radial tree?

(I would think it is - I'm just not that clever :? )

You can see my attempt on codepen here: http://codepen.io/anon/pen/KctDb

I should also mention I haven't added many "info" tags (one is on "Heart -> ICD-10 -> I00) but i dont want to spend the time until I get the tool tip working.

Any suggestions / help would be greatly appreciated!

Thank you!

VividD
  • 10,456
  • 6
  • 64
  • 111
  • [This answer](http://stackoverflow.com/questions/10805184/d3-show-data-on-mouseover-of-circle/10806220#10806220) may help. – Lars Kotthoff May 02 '14 at 08:23

1 Answers1

1

Add this code:

  .append("title")
  .text(function(d) { return d.info; })

to the code where circles are created, as it is displayed here:

enter image description here

... and node "Heart -> ICD-10 -> I00 that contains "info" will get its tooltip!

Modified codepen is here.

NOTE: This will add a tooltip for circles. If you want tooltips for radially placed labels too, than you need analogous code for labels.

Community
  • 1
  • 1
VividD
  • 10,456
  • 6
  • 64
  • 111
  • That makes so much sense! Thank you! – xxsoundgirlxx Jul 29 '14 at 15:10
  • @user3594284, you are welcome! If you think the answer is useful, and solved the problem you described, woudl you maybe consider "voting" for it, or accepting it officially as an answer? (you can do it by pressing appropriate icons at the top left of the answer) :) – VividD Jul 30 '14 at 04:52