Comments (11)
Hi,
the speedometer is controlled using JavaScript, and its value can be set using the update(newValue)
and the animatedUpdate(newValue, animationTime)
APIs.
So, as long as you can fetch (maybe through XHR) the data from your source to the browser's JS engine, you're ready to go :-).
from canvas-speedometer.
Oh I see. Alright, thank you for the quick reply.
from canvas-speedometer.
Your help was very much appreciated. :)
from canvas-speedometer.
You're welcome :-)
from canvas-speedometer.
Sorry but i do have a question. Under which .js do i need to edit?
from canvas-speedometer.
You don't need to edit the speedometer source files: create your own source file containing your logic of fetching data from your external sensor and then call the speedometer's APIs.
E.g. you include speedometer.js, jquery.js and your own "foobar.js" file. This one initializes the speedometer on $(document).ready(), and then it periodically calls jQuery.ajax() to fetch the data from your webservice. Then, in the 'success' callback, you use the speedo's .animatedUpdate() API to update the view.
If you're new to Javascript programming, google around, use the Google Chrome development tools to prototype your code directly in the console, and have fun :-).
~ Marcello (via iPad)
~ [email protected]
~ http://sindro.me/
On 05 Feb 2013, at 02:36, t-swift [email protected] wrote:
Sorry but i do have a question. Under which .js do i need to edit?
—
Reply to this email directly or view it on GitHub.
from canvas-speedometer.
Oh Okay. Thank-you for your advice. :)
from canvas-speedometer.
Hi Sorry to trouble you again. But What does the time variable in your speedometer.html code do? is it the amount of time the speed meter needle moves?
Regards,
Swift
from canvas-speedometer.
Yes - it's the needle animation duration. :-)
from canvas-speedometer.
Okay. Thanks!
from canvas-speedometer.
Regarding the question on using the ajax jquery, basically all i have to do is to make a new .js script to get the value i want from the website, then in the example.js (var Target = XXX) i just have to change it to a new variable?
from canvas-speedometer.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from canvas-speedometer.