Skip to content

Instantly share code, notes, and snippets.

@mbostock mbostock/pie.js
Created Nov 14, 2011

Embed
What would you like to do?
Prototype Chart Template (WIP)
d3.mbostock.pie = function() {
var pie = {},
parent,
data;
var svg = d3.create("svg:svg");
function redraw() {
return pie;
}
pie.data = function(x) {
if (!arguments.length) return data;
data = x;
return redraw();
};
pie.parent = function(x) {
if (!arguments.length) return parent;
parent = x ? svg.remove() : d3.select(parent).adopt(svg);
return pie;
};
return pie;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.