Visualize Data with Scatterplot Graph FCC

Why aren’t my y and x axis in the right spot? (bottom and left)

You have two erros in console:

Error: attribute transform: Expected number, “translate(${padding}, 0)”.

Error: attribute transform: Trailing garbage, “translate(0, ${height - paddi…”.

And this is because you’re using template literals but without using backticks:

  svg.append('g')
     .attr('transform', 'translate(0, ${height - padding})');
  
  svg.append('g')
     .attr('transform', 'translate(${padding}, 0)');
1 Like

Oh, I see. How simple. Thank you!

Why can’t i see any info in the little box that appears when I hover over one of the circles?

Check around line 55 in your code

1 Like

The error was on line 54. I fixed that. But when I hover over the dot, it still does not give all the data in the box.

It’s the same problem that you’ve had in your previous topic:

When you hover over the dot, the data is undefined. So I recommend console logging what is the value that you trying to assign to it :wink:

1 Like