如何将标签添加到d3饼图

时间:2015-09-03 10:10:51

标签: d3.js svg

有人可以帮助我在d3饼图中添加标签。

Fiddle

 // Globals
    var width = 500,
        height = 400,
        margin = 50,
        radius = Math.min(width - margin, height - margin) / 2,  
        // Pie layout will use the "val" property of each data object entry
        pieChart = d3.layout.pie().sort(null).value(function(d){return d.val;}), 
        arc = d3.svg.arc().outerRadius(radius),
        MAX_SECTORS = 15, // Less than 20 please
        colors = d3.scale.category20();

0 个答案:

没有答案