D3 Bar Chart: Not fetching the json data from the provided URl

Tell us what’s happening:
I almost completed the D3 Bar chart project and the only thing remaining is the tooltip part. All my logic is inside the fetch part and that fetching of json data is not returning any response and hence my output is blank. Can anyone please let me know why my code is not able to fetch the data and load the content and what mistake am I making in the code. I could not figure out what is stopping to fetch the data.

Your code so far
My completed code is here => https://codepen.io/sundarboss/full/mdexWbQ

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36.

Challenge: Visualize Data with a Bar Chart

Link to the challenge:

It is because you are using d3.v5. You can’t load data the way you are doing in version 5. Check this doc. on github. If you want your data to load without changing your code use version 4. You can change the URL of the version you are using with the one below.
https://d3js.org/d3.v4.min.js

Hi Nibble,

Thanks a lot. It worked. This was screwing my head from last night. Thanks once again.

1 Like