Skip to content

Latest commit

 

History

History

addATooltipToAD3Element

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Add a Tooltip to a D3 Element

link solution
A tooltip shows more information about an item on a page when the user hovers over that item. There are several ways to add a tooltip to a visualization. This challenge uses the SVG title element.

title pairs with the text() method to dynamically add data to the bars. Append a title element under each rect node. Then call the text() method with a callback function so the text displays the data value.

Tests

Waiting: Your code should have 9 title elements. Waiting: The first title element should have tooltip text of 12. Waiting: The second title element should have tooltip text of 31. Waiting: The third title element should have tooltip text of 22. Waiting: The fourth title element should have tooltip text of 17. Waiting: The fifth title element should have tooltip text of 25. Waiting: The sixth title element should have tooltip text of 18. Waiting: The seventh title element should have tooltip text of 29. Waiting: The eighth title element should have tooltip text of 14. Waiting: The ninth title element should have tooltip text of 9.