2016-09-21 24 views
0

我使用这个代码,以使与JustGage一计:就计 - 数字显示而不是测厚仪

drawGage() { 
    var g1 = new JustGage({ 
     id: "gage1", 
     value: 90, 
     min: 0, 
     max: 100, 
     levelColors: ["blue"], 
     gaugeWidthScale: 0.9, 
     startAnimationTime: 2700, 
     startAnimationType: "bounce", 
    }); 
} 

我有我的index.html这些脚本加载正确:

<script type="text/javascript" src="/assets/js/raphael-2.1.4.min.js"></script> <script type="text/javascript" src="/assets/js/justgage.js"></script>

和我在我的HTML这个div正被追加到:

<div id="gage1"></div>

This Image是我尝试了很多不同的东西后,一遍又一遍地结束了。当我检查SVG时,看起来由于某种原因,path上的stroke属性被设置为none,不知道为什么会出现这种情况,或者这是甚至是我的问题。

任何帮助表示赞赏。

回答

0

这不是一个答案,但你的代码没有出现任何问题。这个作品,例如:

<html> 
<script src="raphael-2.1.4.min.js" charset="utf-8"></script> 
<script src="justgage.js" charset="utf-8"></script> 

<body> 
    <div id="gage1" class="200x160px"></div> 
</body> 
<script type="text/javascript"> 
    function drawGage() { 
     var g1 = new JustGage({ 
      id: "gage1", 
      value: 90, 
      min: 0, 
      max: 100, 
      levelColors: ["blue"], 
      gaugeWidthScale: 0.9, 
      startAnimationTime: 2700, 
      startAnimationType: "bounce", 
     }); 
    } 
    drawGage(); 
</script> 

</html> 

所以,它必须是别的东西。您是否在网页上发现任何错误?在控制台中?你正在使用哪种浏览器?