fix in legend.js

line 109---> var legendText = d3.select(this).select('text')
should be replaced by var legendText = d3.select(this).select('text').node();

else getComputedTextLength() throws an error "undefined is not a funtion".