How to Create a Javascript Speedometer
This is just a simple PoC of a Javascript speedometer for a colleague of mine.
At first I thought that a speedometer would be terrible for visualizing data, but after playing around with it for a while, I can see it could have uses where the minimum and maximum are known and you just want to be able to determine at a glance what the current status is.
A speedometer like visualization could also be useful if you are using something like Comet and the data is rapidly changing. I've included a digital readout1, however you'll notice that with the high frequency of updates in the PoC it's not particularly easy to read compared to the speedo.
Firefox and Opera appear to be doing The Right Thing™ in term of caching the various images for the needle position, but I'm not so sure about IE. In both IE 6 and 7 you'll notice in the status bar that it will repeatedly report that it's downloading the same image and the needle blanks-out while loading far too often. You should be able to fix this by using Javascript to pre-fetch all the needle images.
BTW, sorry about the programmer art :/
If you find this useful, feel free to use the code and images as you like:
- Primarily for accessibility reasons [back]
The Secret of Super Fast Lightboxes »« The Secret of Keeping Web Apps Responsive










The code
000.0 km/h
Start Speedo
Hi Ronn, I think WordPress truncated your comments. Could you try again?
what is the code script of these speedklok can you script emailen
Hi Ronn, The code is in the zip file above.
Yes that to see I.. But what is script which you must use to get it active..
Ronn:)
Hi Ronn, there is an option in the browser to view the source of a page…
the speedometer sample does not show any output only the background image is visible wherease the needle does not appear visible could u please explain the reason
Looks like I broke it at some stage. Until I have a chance to fix it, just use the zip file and the code above to embed.
Can anybody tell how to run the speedometer script in a jsp page?
Just include the html listed above in the reply to Ronn in your JSP page.