d3js with node, how do I add a lines to pie chart?
<p>d3js newbie here. I am using d3js to render an svg on the server. After going over some tutorials I was able to come up with this:  </p>

<pre><code>var fs = require('fs');
var d3 = require('d3');
var jsdom = require('jsdom');
var _ = require("underscore");
var chartWidth = 500, chartHeight = 500;

var arc = d3.svg.arc()
    .outerRadius(chartWidth/2 - 10)
    .innerRadius(0);

var colours = ['#98abc5','#8a89a6','#7b6888','#6b486b','#a05d56',"#d0743c", "#ff8c00"];

var pieData = [ 
    {
        "category" : "Category A",
        "amount" : 300
    },
    {
        "category" : "Category B",
        "amount" : 300
    }
];

makePie( pieData );

function makePie( pieData, outputLocation ){
    var amount = _.pluck( pieData, "amount" ); 
    var category = _.pluck( pieData, "category" );

    jsdom.env({
        html:'',
        features:{ QuerySelector:true }, //you need query selector for D3 to work
        done:function(errors, window){
            window.d3 = d3.select(window.document); //get d3 into the dom

            //do yr normal d3 stuff
            var svg = window.d3.select('body')
                .append('div')
                    .attr('class','container') //make a container div to ease the saving process
                .append('svg')
                    .attr({
                        xmlns:'http://www.w3.org/2000/svg',
                        width:chartWidth,
                        height:chartHeight
                    })
                .append('g')
                    .attr('transform','translate(' + chartWidth/2 + ',' + chartWidth/2 + ')');

            svg.selectAll('.arc')
                .data( d3.layout.pie()(amount) )
                    .enter()
                .append('path')
                    .attr({
                        'class':'arc',
                        'd':arc,
                        'fill':function(d,i){
                            return colours[i];
                        },
                        'stroke':'#fff'
                    });
            //write out the children of the container div
            fs.writeFileSync("test.svg", window.d3.select('.container').html()) //using sync to keep the code simple

        }
    });
}  
</code></pre>

<p>Although this renders the SVG chart, I do not know how to add lines to the chart which will show which slice belongs to which category.  </p>

<p>How do I do that?</p>