freeCodeCamp/guide/english/certifications/data-visualization/data-visualization-with-d3/create-a-scatterplot-with-s.../index.md

35 lines
653 B
Markdown
Raw Normal View History

2018-10-12 19:37:13 +00:00
---
title: Create a Scatterplot with SVG Circles
---
## Create a Scatterplot with SVG Circles
### Hint 1
2018-10-12 19:37:13 +00:00
Use the ` data() `, ` enter() `, and ` append() ` methods.
2018-10-12 19:37:13 +00:00
### Hint 2
Append circles in the ` append() ` method.
### Solution
Chain the following lines of code in the ` svg.selectAll("circle") ` chain:
```javascript
.data(dataset)
.enter()
.append("circle")
```
The ` svg.selectAll("circle") ` chain should look like:
```javascript
svg.selectAll("circle")
.data(dataset)
.enter()
.append("circle")
```
##### Note
The circles won't be visible because we haven't set their attributes yet. We'll do that in the next challenge.