常规定义:
var width = 500,
height = 500;
var dataset = [30,10,43,55,13]
var color = d3.scale.category10()
var svg = d3.select("body").append("svg")
.attr("width",width)
.attr("height",height)
var pie =d3.layout.pie()
拖拽函数的定义:
var drag = d3.behavior.drag()
.on("drag",dragmove)
function dragmove(d){
d.dx += d3.event.dx;
d.dy += d3.event.dy;
d3.select(this)
.attr("transform","translate("+ d.dx+","+ d.dy+")")
}//<span style="font-family: Arial, Helvetica, sans-serif;">偏移量=当前偏移量+拖拽偏移量</span>
绘制饼状图:
var outerRadius =