Giter Site home page Giter Site logo

Comments (4)

jpgateaux avatar jpgateaux commented on June 11, 2024 1

Sorry what I was trying to do was replace percentage caption with time remaining . Here is what I came up with:
"captionText":function (percentage, time) { return Math.ceil(time.remaining/1000).toFixed(); }

from canvas-circular-countdown.

jpgateaux avatar jpgateaux commented on June 11, 2024

Newer mind after digging I foumd the answer. Better documentation in order;

from canvas-circular-countdown.

georapbox avatar georapbox commented on June 11, 2024

I think what you're looking for is Example 5 where you can update the captionText while the timer is running. If you use the captionText as function, the second argument passed is an object representing the remaining/elapsed time.

This is documented for captionText option in the 1 note:

If it is a function, the remaining percentage and an object containing the remaining and elapsed time are passed as parameters and it should return the appropriate type for each option. For example, for showCaption should return a boolean (true or false), but for captionColor should return a string. Useful when you need to change some options' values depending on the remaining percentage or the remaining/elapsed time.

from canvas-circular-countdown.

georapbox avatar georapbox commented on June 11, 2024

Yep, this is pretty much the way to use it.

from canvas-circular-countdown.

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.