We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Custom AngularJS Directive with ejCircularGauge Reverting To Original Value

http://jsplayground.syncfusion.com/pyc4451u

I need to create a custom AngularJS directive for the Javascript circular gauge so I can dynamically set the number of scale ranges at runtime (I couldn't figure out how to do this with the delivered AngularJS directive).  I'm starting off very basic with the default gauge and just updating the value every 10 seconds.  Every time the value is changed, the gauge redraws itself and goes back to the first value it received.  

When I step through the Javascript in Chrome developer tools, the pointer does change to the new value after it is updated, but later redraws itself back to the original value.

I'm no SyncFusion or AngularJS expert so any help is appreciated.

Thanks,
Craig

2 Replies

CB Craig Boucher September 14, 2017 09:07 PM UTC

I figured out that I needed to set enableAnimation to false and then it worked correctly.

Craig



SK Saravana Kumar Kanagavel Syncfusion Team September 15, 2017 08:49 AM UTC

Hi Craig, 

Thanks for contacting Syncfusion Support. 
We have analyzed your query and modified the sample based on your requirement. Please refer the code example below 

[JS] 
         var ejObject = $(element).data("ejCircularGauge");      
            scope.$watch("value", function(newVal, oldVal) { 
                        ejObject.setPointerValue(0,0,newVal); // setPointerValue(0 => represent the scale index, 0 => represent the pointer index,newVal => to update the pointer value ) 
               }); 
 

In the above code, we are calling the method of ”setPointerValue” to update the pointer value. In the case, if you have setting the enableAnimation property either true or false, it will work properly. 

You can find the sample from the below location. 

Please let us know if you have any concern on this. 

Regards, 
Saravana Kumar K. 



Loader.
Live Chat Icon For mobile
Up arrow icon