Liad Livnat
Liad Livnat

Reputation: 7475

AngularJS + easy pie chart - Animation is not working

Animation is not working, can't figure out how to fix it, can you help?

i tired to make it work on jsfiddle but it's not working for some reason

html:

    <script>
            var app = angular.module('app', ['easypiechart']);
            app.controller('chartCtrl', ['$scope', function ($scope) {
                    $scope.percent = 65;
                    $scope.anotherPercent = -45;
                    $scope.anotherOptions = {
                            animate:{
                                    duration:100,
                                    enabled:true
                            },
                            barColor:'#2C3E50',
                            scaleColor:false,
                            lineWidth:20,
                            lineCap:'circle'
                    };
            }]);
    </script>

http://jsfiddle.net/LVTM4/

but you can run download the example and run it, and see for yourself,

JQuery is working with animation, Angular is not https://github.com/rendro/easy-pie-chart

Upvotes: 1

Views: 4545

Answers (1)

Fresheyeball
Fresheyeball

Reputation: 30015

Your fiddle is a mess.

You have your code set to 'onLoad' which means its being wrapped by jsfiddle to fire only after page load. Then you have script in the html itself, that script will fire out of time with the rest of the document. Also you have <body> tags in your html. Those should not be there in a fiddle. Lastly, you didn't even bootstrap the html, so angular would never run in the first place. Also you didn't even check to see if the directive fires at all.

This is a mess. Clean it up.

Here's a slight leg up.

If you expect to get free help, at least don't waste everyones time with this kind of garbage.


Just a tip. Don't copy paste the plugin you want to test into jsfiddle. Include it as an external resource. That way your fiddle is just your implementation, which is all you should be testing anyway.


Here it is working in jsfiddle. DEMO

Upvotes: 2

Related Questions