fix in legend.js , error was undefined is not a function , by getComputedTextLength();