Created
April 18, 2014 14:59
-
-
Save natecavanaugh/11048522 to your computer and use it in GitHub Desktop.
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
var pieChart = A.Widget.getByNode($0); | |
var graphic = pieChart.get("graph").get("graphic"); | |
var width = graphic.get('width'), height = graphic.get('width'); | |
var newWidth = width - 100, newHeight = height - 100; | |
var circle = graphic.addShape({type: 'circle', | |
width: newWidth, | |
height: newHeight, | |
x: 100, | |
y: 100, | |
fill: {color: '#ffffff'}, | |
stroke: {color: '#555555', width: 1} | |
}); | |
var xy = graphic.getXY(); | |
diff = 40; | |
xy[0] += diff/2; | |
xy[1] += diff/2; | |
circle.setXY(xy); | |
circle.set('width', width - diff); | |
circle.set('height', height - diff); | |
circle.set('fill', {type: "radial", | |
stops: [ | |
{"color":"#555","opacity":1,"offset":0}, | |
{"color":"#000","opacity":1,"offset":1} | |
], | |
cx: 0.5, | |
cy: 0.5, | |
fx: 0.48, | |
fy: 0.02, | |
r: 0.49, | |
rotation: 0 | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment