Path: blob/master/web-gui/buildyourownbotnet/assets/js/easy-pie-chart/src/angular.directive.js
1293 views
(function (angular) {12'use strict';34return angular.module('easypiechart', [])56.directive('easypiechart', [function() {7return {8restrict: 'AE',9require: '?ngModel',10scope: {11percent: '=',12options: '='13},14link: function (scope, element, attrs) {1516scope.percent = scope.percent || 0;1718/**19* default easy pie chart options20* @type {Object}21*/22var options = {23barColor: '#ef1e25',24trackColor: '#f9f9f9',25scaleColor: '#dfe0e0',26scaleLength: 5,27lineCap: 'round',28lineWidth: 3,29size: 110,30rotate: 0,31animate: {32duration: 1000,33enabled: true34}35};36scope.options = angular.extend(options, scope.options);3738var pieChart = new EasyPieChart(element[0], options);3940scope.$watch('percent', function(newVal, oldVal) {41pieChart.update(newVal);42});43}44};45}]);4647})(angular);484950