Just gage - numbers show but not gage

469 views Asked by At

I am using this code to make a gage with JustGage:

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

I have these scripts in my index.html that load properly:

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

and I have this div in my html that is being appended to:

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

this Image is what I end up with over and over again after trying a lot of different stuff: enter image description here
When I inspect the SVG it looks like the stroke attribute on the path is being set to none for some reason, not sure why this is or if this is even my problem.

Any help is appreciated.

1

There are 1 answers

0
amadan On

It's not an answer, but there doesn't appear to be anything wrong with your code. This works, for example:

<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>

So, it's got to be something else. Are you getting any errors on the page? In the console? Which browser are you using?