我正在使用以下代码对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附加到:
<div id="gage1"></div>
在尝试了很多不同的东西之后,这张图片是我一遍又一遍的总结:
当我检查SVG时,出于某种原因,似乎
stroke
上的path
属性被设置为none
,不确定是为什么还是什至是我的问题。任何帮助表示赞赏。
最佳答案
这不是一个答案,但是您的代码似乎没有任何错误。例如,这有效:
<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>
因此,它必须是别的东西。页面上有错误吗?在控制台中?您正在使用哪个浏览器?
关于css - 只是量具-数字显示但不具量具,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39625323/