From ec25ccfb32e5e9537d95f68bf5c0e631d1a828f3 Mon Sep 17 00:00:00 2001 From: The Coding Aviator <34807532+thecodingaviator@users.noreply.github.com> Date: Wed, 7 Nov 2018 04:01:05 +0530 Subject: [PATCH] Update index.md (#34229) --- .../index.md | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/guide/english/certifications/data-visualization/data-visualization-with-d3/add-labels-to-scatter-plot-circles/index.md b/guide/english/certifications/data-visualization/data-visualization-with-d3/add-labels-to-scatter-plot-circles/index.md index d8a11fac61..7f66a75fa9 100644 --- a/guide/english/certifications/data-visualization/data-visualization-with-d3/add-labels-to-scatter-plot-circles/index.md +++ b/guide/english/certifications/data-visualization/data-visualization-with-d3/add-labels-to-scatter-plot-circles/index.md @@ -3,8 +3,27 @@ title: Add Labels to Scatter Plot Circles --- ## Add Labels to Scatter Plot Circles -This is a stub. Help our community expand it. +In this challenge, you are required to set the x attribute so it's 5 units more than the value you used for the cx attribute on the circle. Set the y attribute the same way that's used for the cy value on the circle, for the text element. -This quick style guide will help ensure your pull request gets accepted. +### Hint 1 - +Target the `svg.selectAll("text")` codeblock. + +### Hint 2 + +Use `d[0]` and `d[1]` for the data to be displayed. + +### Hint 3 + +The format for display has to be `x, y`. + +##### Note +There is a space between the comma and the y attribute. + +### Solution + +Since, you need to add the x any y attributes similar to those as they have been set for the circle, add this to the `svg.selectAll("text")` codeblock: + +```javascript +.text((d) => (d[0] + ", " + d[1])) +```