2013-07-22 36 views
0

我有一种情况,我使用相同的线性测量仪测量负向和正向速度。我想知道是否有可能将指针从中心开始作为零点?这里是我的代码:是否可以让线性仪表指针从中心开始?

<script> 
    function createSpeedGauge() { 
     $("#speedBar").kendoLinearGauge({ 
      pointer: { 
       value: 0, 
       color: "black", 
       start: 0 
      }, 
      scale: { 
       majorUnit: 20, 
       minorUnit: 2, 
       min: -120, 
       max: 120, 
       vertical: true, 
       reverse: true, 
       ranges: [ 
        { 
         from: -120, 
         to: -30, 
         color: "#ffc700" 
        }, 
        { 
         from: 120, 
         to: 30, 
         color: "#ffc700" 
        } 
       ] 
      } 
     }); 
    } 

    $(document).ready(function() { 
     createSpeedGauge(); 
    }); 
</script> 

Dashboard

我已经附上它是如何的设定(有问题的仪表右侧)的图像。如果这是按照我想要的方式设置的,那么这个测量仪会从这张图片读取-120。 (现在,它在黑色条上显示“0”,因为这是我在js中设置的值。)有什么建议吗?

回答

0

通过将起始点设置为0并使用SignalR更新条的另一端来解决。 (初始起点)

相关问题