Added solution to Add a Hover Effect to a D3 Element (#19606)
* Update index.md * Update index.md
This commit is contained in:
committed by
Aditya
parent
64cdcfc613
commit
599b0ccdda
@ -3,8 +3,18 @@ title: Add a Hover Effect to a D3 Element
|
||||
---
|
||||
## Add a Hover Effect to a D3 Element
|
||||
|
||||
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/data-visualization/data-visualization-with-d3/add-a-hover-effect-to-a-d3-element/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
|
||||
### Hint 1
|
||||
|
||||
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
|
||||
Add the ` bar ` class to all `rect ` elements.
|
||||
|
||||
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
|
||||
### Hint 2
|
||||
|
||||
Use the ` attr() ` method to add attributes.
|
||||
|
||||
### Solution
|
||||
|
||||
Add the following line of code to the end of your ` rect ` methods chain:
|
||||
|
||||
```javascript
|
||||
.attr("class","bar");
|
||||
```
|
||||
|
Reference in New Issue
Block a user