Adding legend to plot - d3
问题 After plotting a donut chart, I'm trying to add some legend, based on the following example: http://bl.ocks.org/ZJONSSON/3918369 However, I'm receiving this error: TypeError: undefined is not an object (evaluating 'n.apply') I've printed the return of line 131 and all the legend names are printed. I don't know what's is causing the undefined error print. This is my main code: var width = 300, height = 300, radius = Math.min(width, height) / 2; var color = d3.scale.ordinal() .range(colorrange)