Label names are not displayed from input data in pie transition chart of d3.js
问题 I am using d3.js to draw a pie transition chart. But when labels are placed in the data array as show below: data = [{"label":"sector1", "value":25}, {"label":"sector2", "value":45}] The pie chart won't be displayed. Instead " NaN " will be printed. The complete code is pasted below: var w = 400, h = 400, r = Math.min(w, h) / 2, data = [{"label":"sector1", "value":25}, {"label":"sector2", "value":45}], // Data with label-value pairs color = d3.scale.category20(), arc = d3.svg.arc()