Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8520865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:39:06+00:00 2026-06-11T06:39:06+00:00

I am working on a progress bar plugin for jQuery that utilizes Raphael for

  • 0

I am working on a progress bar plugin for jQuery that utilizes Raphael for smooth graphics.

I tried to transform the attribute function provided by this Raphael example (polar clock).

The problem is, that at first I didn’t notice that the Raphael example also has the deformation error there. Relatively larger circles just mitigate it. Looking at smaller ones, it is noticeable.

And yes, I have basicly copy-pasted the function with some minor tweaks, but the end result sport the same error.

I have set up a JSBin where I’ve added reference circles to my scene, so it’s easier to spot the issue: http://jsbin.com/ekovir/1

How do I tune the Arc function to draw proper circle?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:39:07+00:00Added an answer on June 11, 2026 at 6:39 am

    I have found what caused the circle to be deformed.

    I used stroke-width to set the “fatness” / “cap” of the circle, and the larger it gets, the more it deforms.

    At least, those are my observations, it could as well technically be caued by something else.

    Anyways, in order to get proper donut, I ended up with this method:

    /**
     * Donut circle drawing
     *
     * @param  integer  start       Percentage to start with
     * @param  float    diameter
     * @param  float    fat         How fat should the circle bar be
     * @return object
     */
    var fatDonutArc = function (start, diameter, fat)
    {
        var center = diameter / 2;
        var outerRadius = center;
        var innerRadius = center - fat; // subtract fat
    
        var alpha = 360 / 100 * start;
        var a = (90 - alpha) * Math.PI / -180; // -180 starts to draw from 12 o'clock
    
        // calculate outer ring point coordinates
        var outerX = center + outerRadius * Math.cos(a);
        var outerY = center + outerRadius * Math.sin(a);
    
        // calculate inner ring point coordinates
        var innerX = center + innerRadius * Math.cos(a);
        var innerY = center + innerRadius * Math.sin(a);
    
        // path cache
        var path;
    
        if (start !== 100)
        {
            path = [
                // move to start point of inner ring
                [
                    "M",
                    center,
                    center - innerRadius
                ],
    
                // draw a line to outer ring
                [
                    "L",
                    center,
                    center - outerRadius
                ],
    
                // arc to outer ring end
                [
                    "A",
                    outerRadius,
                    outerRadius,
                    0,
                    +(alpha > 180),
                    1,
                    outerX,
                    outerY
                ],
    
                // move to inner ring end
                [
                    "L",
                    innerX,
                    innerY
                ],
    
                // arc to inner ring start
                [
                    "A",
                    innerRadius,
                    innerRadius,
                    0,
                    +(alpha > 180),
                    0,
                    center,
                    center - innerRadius
                ]
            ];
        }
        else
        {
            path = [
                // move to outer ring start
                [
                    "M",
                    center,
                    center - outerRadius
                ],
    
                // arc around the clock
                [
                    "A",
                    outerRadius,
                    outerRadius,
                    0,
                    +(alpha > 180),
                    1,
                    outerX - .1, // subtract, otherwise the path becomes "reset"
                    outerY
                ],
    
                // connect
                [
                    "z"
                ],
    
                // move to inner circle start
                [
                    "M",
                    innerX,
                    innerY
                ],
    
                // arc around the clock
                [
                    "A",
                    innerRadius,
                    innerRadius,
                    0,
                    +(alpha > 180),
                    0,
                    innerX + .1, // subtract, otherwise the path becomes "reset"
                    innerY
                ],
    
                // and connect
                [
                    "z"
                ]
            ];
        }
    
        return {
            path : path
        };
    };
    

    That’s a mashup of: raphael.js – converting pie graph to donut graph + http://raphaeljs.com/polar-clock.html

    Here I have set up an example, to see it in action: http://jsbin.com/erusos/1

    There still is one unanswered question: In Chrome, is it the CSS renderer, that doesn’t fully round the circle, or is it the SVG?

    Enjoy!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on displaying a progress bar using JQuery during a long running
I am trying to use jquery ui progress bar with valum file upload plugin.
How would i show that the progress bar is working there is no Refresh()
I have a working solution that reports progress & text to a progress bar
We have designed a Progress bar, using Jquery Ui. we need a program that
I am working on creating a progress bar for ffmpeg in java. So for
i have used progress bar in my application..my application is working fine but the
I'm working with Progress 10.1c I have a class that contains both static and
I'm trying to get a file upload progress bar working in a rails 3
So, i'm working on a progress bar for a CSV processing script. dnc_scrubber.php goes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.