Skip to content

Instantly share code, notes, and snippets.

View missingdays's full-sized avatar
🎯
Focusing

Evgeny Bovykin missingdays

🎯
Focusing
View GitHub Profile
@missingdays
missingdays / pie-explode.js
Last active August 29, 2015 14:27 — forked from miguelmota/pie-explode.js
d3.js explode pie chart
function explode(d, index) {
var offset = 10;
var angle = (d.startAngle + d.endAngle) / 2;
var xOff = Math.sin(angle) * offset;
var yOff = -Math.cos(angle) * offset;
return 'translate(' + xOff + ',' + yOff +')';
}
arc.attr('transform', explode);