AngularJS directive for creating pie charts with SVG
I will love to get feture requests for this directive
http://shotap.github.io/sp-pie/
- Very lite! <1KB
- Uses SVG
- Copy
sp-pie.min.js
- Add reference in the index.html
- Add depedencie in your app
angular.module('myApp', ['sp-pie']);
define the $scope
object:
$scope.slices = [
{ value: 14, color: '#f06'},
{ value: 60, color: 'yellowgreen'},
{ value: 26, color: 'navy'}
];
The value is in %
<sp:pie size="200" slices="slices"></sp:pie>
param | type | description |
---|---|---|
size | int | the size of the chart, both width ans height |
slices | string | name of the $scope variable with the slices information |
This directive was created with ♥ according to keynote by Lea Verou