Skip to content Skip to sidebar Skip to footer

Simple Bar Chart D3

Copying simple example for barchart as per D3.js page still I am not getting anything on my screen except left black line. Can someone help me out? HTML

Solution 1:

It looks like the issue is because of the way your IDE is understanding the TABs in the .tsv file.

I suspect that if you put some console logging in (or debug) at line 37 you will see that both the letter and frequency value is being read into the "letter" property. i.e the TAB between the two values is not being recognised. This is turn will lead to a 'Nan' value for the y which propagates to a 'Nan' value for the height on each rect.

There is probably a setting in your IDE that allows the Tabs to be recognised as intended.

Post a Comment for "Simple Bar Chart D3"