jQuery UI Widgets Forums Plugins AngularJS jqx-Gauge

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 9 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    jqx-Gauge Posts
  • jqx-Gauge #78525

    BladeMcKain
    Participant

    Hi all,
    in my index.html i have

    <div class="gaugeBox">
           <jqx-Gauge jqx-instance="gaugeIst" jqx-settings="jqxSettings" jqx-value="jqxValue.Dust" ></jqx-Gauge> 
    </div>

    in my controller, i have

    $scope.gaugeIst = {};
    	 
    	 $scope.jqxSettings =
         {
    			 height: '100%', 
    			 radius: '25%',
    			 value: 0,
    		     animationDuration: 1200,
    			 min: 0,
    			 max: 10000,
    			 labels: { interval: 2000, position: 'inside' },
    			 ranges: [{ startValue: 0, endValue: 5, style: { fill: '#C9C9C9', stroke: '#C9C9C9' }, endWidth: 5, startWidth: 1, startDistance: 10, endDistance: 10 },
    	                    { startValue: 5, endValue: 10, style: { fill: '#FCF06A', stroke: '#FCF06A' }, endWidth: 10, startWidth: 5, startDistance: 10, endDistance: 10 },
    	                    { startValue: 10, endValue: 16, style: { fill: '#FCA76A', stroke: '#FCA76A' }, endWidth: 15, startWidth: 10, startDistance: 10, endDistance: 10 },
    	                    { startValue: 16, endValue: 22, style: { fill: '#FC6A6A', stroke: '#FC6A6A' }, endWidth: 20, startWidth: 15, startDistance: 10, endDistance: 10 }],
    	         caption: { value: 'Dust', position: 'bottom', offset: [0, 10], visible: true },
    	         border: { showGradient: true, size: '8%', style: { stroke: '#898989'}, visible: true }
    
    	       
         };
    	 
    
    	 $scope.jqxSettings.apply('val', 6666);

    But i get the error

    
    TypeError: $scope.jqxSettings.apply is not a function
    

    What is wrong?
    I want dinamically change the value

    Thx

    jqx-Gauge #78531

    Dimitar
    Participant

    Hi BladeMcKain,

    Before calling $scope.jqxSettings.apply('val', 6666); you would have to make sure the gauge has been initialized. That is why we suggest you set the value on the jqxGaugeCreated event:

    $scope.$on('jqxGaugeCreated', function (event, arguments) {
        $scope.jqxSettings.apply('val', 6666);
    });

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.