-
-
Save missingdays/3e7e9966702256463713 to your computer and use it in GitHub Desktop.
d3.js explode pie chart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment