Skip to content

Instantly share code, notes, and snippets.

@natecavanaugh
Created April 18, 2014 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natecavanaugh/11048522 to your computer and use it in GitHub Desktop.
Save natecavanaugh/11048522 to your computer and use it in GitHub Desktop.
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