Giter Club home page Giter Club logo

Comments (11)

vjt avatar vjt commented on July 20, 2024

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.

t-swift avatar t-swift commented on July 20, 2024

Oh I see. Alright, thank you for the quick reply.

from canvas-speedometer.

t-swift avatar t-swift commented on July 20, 2024

Your help was very much appreciated. :)

from canvas-speedometer.

vjt avatar vjt commented on July 20, 2024

You're welcome :-)

from canvas-speedometer.

t-swift avatar t-swift commented on July 20, 2024

Sorry but i do have a question. Under which .js do i need to edit?

from canvas-speedometer.

vjt avatar vjt commented on July 20, 2024

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.

t-swift avatar t-swift commented on July 20, 2024

Oh Okay. Thank-you for your advice. :)

from canvas-speedometer.

t-swift avatar t-swift commented on July 20, 2024

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.

vjt avatar vjt commented on July 20, 2024

Yes - it's the needle animation duration. :-)

from canvas-speedometer.

t-swift avatar t-swift commented on July 20, 2024

Okay. Thanks!

from canvas-speedometer.

t-swift avatar t-swift commented on July 20, 2024

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

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.