Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gauge.js - Can't get to work

Tags:

jquery

I'm trying to implement http://bernii.github.com/gauge.js/ using the gauge.min.js not coffee. But for the life of me I cannot get this to even show. Could anyone give me the code to make this show up? Like write the html doc, then I can edit it and place in my work. please any help would be great. Bit of noob here. Thanks

If anyone could make the doc and link to it, would be great.

like image 551
user1139498 Avatar asked Dec 27 '12 17:12

user1139498


2 Answers

The element that you apply the Gauge effect on needs to be a canvas element, not a div.

See: http://jsfiddle.net/RctL3/1/

One has to admit that this is only mentioned in a subordinate clause in the docs:

The Gauge class handles drawing on canvas and starts the animation.

like image 116
m90 Avatar answered Nov 13 '22 00:11

m90


Change your <div id="foo"> into a <canvas id="foo"> and it will work just fine.

like image 21
flashfox Avatar answered Nov 12 '22 23:11

flashfox