From f46e517eb7fd8610ebfcdce6cb5022dd1d92b366 Mon Sep 17 00:00:00 2001 From: The Coding Aviator <34807532+thecodingaviator@users.noreply.github.com> Date: Wed, 17 Oct 2018 22:04:35 +0530 Subject: [PATCH] Added D3 solution to scatterplot challenge (#19609) * Update index.md * Update index.md --- .../index.md | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/guide/english/certifications/data-visualization/data-visualization-with-d3/create-a-scatterplot-with-svg-circles/index.md b/guide/english/certifications/data-visualization/data-visualization-with-d3/create-a-scatterplot-with-svg-circles/index.md index 402e16ed5d..abc176b197 100644 --- a/guide/english/certifications/data-visualization/data-visualization-with-d3/create-a-scatterplot-with-svg-circles/index.md +++ b/guide/english/certifications/data-visualization/data-visualization-with-d3/create-a-scatterplot-with-svg-circles/index.md @@ -3,8 +3,32 @@ title: Create a Scatterplot with SVG Circles --- ## Create a Scatterplot with SVG Circles -This is a stub. Help our community expand it. +### Hint 1 -This quick style guide will help ensure your pull request gets accepted. +Use the ` data() `, ` enter() `, and ` append() ` methods. - +### 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.