From 94508eba890d1bd7029ee2e02a335a922977621b Mon Sep 17 00:00:00 2001 From: The Coding Aviator <34807532+thecodingaviator@users.noreply.github.com> Date: Wed, 7 Nov 2018 04:00:21 +0530 Subject: [PATCH] Added solution to D3 scaling challenge (#34230) * Update index.md * Update index.md --- .../create-a-linear-scale-with-d3/index.md | 40 +++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/guide/english/certifications/data-visualization/data-visualization-with-d3/create-a-linear-scale-with-d3/index.md b/guide/english/certifications/data-visualization/data-visualization-with-d3/create-a-linear-scale-with-d3/index.md index eaafbc3ff2..750aa46481 100644 --- a/guide/english/certifications/data-visualization/data-visualization-with-d3/create-a-linear-scale-with-d3/index.md +++ b/guide/english/certifications/data-visualization/data-visualization-with-d3/create-a-linear-scale-with-d3/index.md @@ -3,8 +3,42 @@ title: Create a Linear Scale with D3 --- ## Create a Linear Scale with D3 -This is a stub. Help our community expand it. +In this D3 challenge you are required to change the scale variable to create a linear scale. Then set the output variable to the scale called with an input argument of 50. -This quick style guide will help ensure your pull request gets accepted. +### Hint 1 - +The syntax for creating a scale is: +```javascript +const scale = d3.scaleLinear(); +``` + +### Hint 2 + +The `const` scale is a method, which accepts a value. + +### Hint 3 + +The scaling factor should be set to `50`. + +### Hint 4 + +The scaling factor is set like this: +```javascript +const output = scale(scalingFactor); +``` +Where `scalingFactor` is a number. + +### Solution + +To solve this challenge, the `scale` variable has to be re-initialized with a D3 scale ans the scaling factor in the output has to be set to `50`, to do this, change you code to look like this: +```javascript + + + +```