Tell us what’s happening:
The tests are not working correctly. It’s failing on the tests for the 2nd-5th , 7th and 8th divs which is very odd… Might be a bug on the platform!?
I did the correct d*10
multiplication. Also checked the elements using Dev Tools. It has the correct height and margins in there.
Your code so far
<style>
.bar {
width: 25px;
height: 100px;
/* Only change code below this line */
margin: 2px;
/* Only change code above this line */
display: inline-block;
background-color: blue;
}
</style>
<body>
<script>
const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];
d3.select("body").selectAll("div")
.data(dataset)
.enter()
.append("div")
.attr("class", "bar")
.style('height', d => d*10+'px');
</script>
</body>
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36
.
Challenge: Change the Presentation of a Bar Chart
Link to the challenge:
https://www.freecodecamp.org/learn/data-visualization/data-visualization-with-d3/change-the-presentation-of-a-bar-chart