2013-03-28 14 views

回答

3

你要找的属性是animationDuration,每API文档上dojox/dgauges/CircularRangeIndicator

以毫秒为单位的值更改动画的持续时间。默认值为 0.动画发生在用户交互和编程值更改上。将此属性设置为0可禁用动画。

我创建了一个测试jsfiddle来证明这一点:

标记:

<body class="claro"> 
    <div data-dojo-type="dojox/dgauges/components/default/CircularLinearGauge" data-dojo-id="gauge" value="20" minimum="-50" maximum="50" animationDuration="100" style="width:300px; height:300px"></div> 
</body> 

代码:

require(['dojo/parser', 'dojox/dgauges/components/default/CircularLinearGauge', 'dojo/domReady!'], function (parser, CircularLinearGauge) { 
    parser.parse(); 
    console.log('parsed'); 
    setInterval(function() { 
     var newVal = Math.ceil(Math.random() * (100) - 50); 
     console.log('setting value to', newVal); 
     gauge.set('value', newVal); 
    }, 1000); 
});