NumenorForLife
NumenorForLife

Reputation: 1746

Bar Chart D3.js Error: Invalid value for <rect> attribute

I am trying to implement Mbostock's Bar Chart (http://bl.ocks.org/mbostock/3885304), literally copy-pasting it here: http://bl.ocks.org/jcahan/6befca00bfaab1e731b6. However, as you can see by clicking the link, the graph does not properly load. The Console identifies the errors to be:

Error: Invalid Value for <rect> attribute y = "NaN"
Error: Invalid value for <rect> attribute height="NaN"

I do not see how either of our codes are different. I suspect that there is the chance that I did not properly create the data.tsv file within the gist, but I may be mistaken.

Upvotes: 2

Views: 4810

Answers (1)

Lars Kotthoff
Lars Kotthoff

Reputation: 109232

When you copied the TSV file, the tab separating the two headers was replaced by two spaces. After you've fixed that, you need to replace that file in your Gist.

Upvotes: 2

Related Questions