rendro/easy-pie-chart — pull request #73 by stereoscott (2014-01-25 01:42:03+00:00)
Title: Add accessor functions for canvas and ctx within the CanvasRenderer class

Since the `barColor` function already has access to `this.renderer`, we were just one step away from being able to use a canvas gradient in our `barColor` definition. With this minor change (allowing outside access to ctx and canvas) we can use a gradient fill, too.

Check out an example here: http://www.codepen.io/stereoscott/pen/wiKHD

```
var element = document.querySelector('.chart');
new EasyPieChart(element, {
barColor: function(percent) {
var ctx = this.renderer.ctx();
var canvas = this.renderer.canvas();
var gradient = ctx.createLinearGradient(0,0,canvas.width,0);
gradient.addColorStop(0, "#ffe57e");
gradient.addColorStop(1, "#de5900");
return gradient;
},
trackColor: '#cccccc',
scaleColor: false,
lineWidth: 40,
lineCap: 'butt',
size: 400,
rotate: 180
});
```

It's not a 360 curved linear gradient, but still provides a nice visual effect.
cc: https://github.com/rendro/easy-pie-chart/issues/40