progressbar.js icon indicating copy to clipboard operation
progressbar.js copied to clipboard

IE animation issue

Open Astyan42 opened this issue 9 years ago • 13 comments

There is an issue while trying to animate a progress bar under IE. If you use 7 as a strokeWidth, the animation went wrong. strokeWidth = 6 does not reproduce issue here is a fiddle :

http://jsfiddle.net/k11e670p/

Astyan42 avatar Jun 17 '15 13:06 Astyan42

Nice! I came here to report the exact same thing (I even made a fiddle), but I didn't know 7 was a problematic number. In fact, I see that all the numbers >= 7 that I try reproduces the problem. 6 works.

cmeeren avatar Jun 21 '15 21:06 cmeeren

Hmm strange. If you know how to fix the issue, please let me know. This sounds like a SVG rendering problem with IE which is potentially hard to fix.

kimmobrunfeldt avatar Jul 10 '15 12:07 kimmobrunfeldt

Same issue with strokeWidth > 6 in IE11, has anyone found a solution to this by any chance?

rossanthony avatar Aug 18 '15 13:08 rossanthony

Same issue here on IE8 (and superior).

pbellon avatar Sep 28 '15 08:09 pbellon

I've tried to debug this issue a couple of times with no luck. It might be necessary to file a bug to IE browser.

kimmobrunfeldt avatar Oct 07 '15 07:10 kimmobrunfeldt

Bump. My code isn't public yet -Any volunteers to file the bug? https://connect.microsoft.com/IE/content/content.aspx?ContentID=29582

danolsavsky avatar Jan 13 '16 16:01 danolsavsky

The "solution" to this bug is to create the path with a smaller stroke-width and then adjust the path and viewbox values to blow the svg up again.

once again, shame on ie!

kubante avatar Aug 09 '16 09:08 kubante

Changing the stroke value to < 7 works

query-wow avatar Oct 07 '16 17:10 query-wow

I'll report the bug to IE and Edge at some point: here's a minimal reproducible example: http://jsfiddle.net/fdu8zdd7/2/

kimmobrunfeldt avatar Oct 17 '16 10:10 kimmobrunfeldt

What worked for me: animating the strokeWidth to the value I need.

Like in this example: https://jsfiddle.net/kimmobrunfeldt/72tkyn40/

Side effect: if your value is 20%, strokeWidth will also only be animated to 20%. Workaround: Set easing to "linear" and animate strokeWidth to an appropriate bigger value:

var strokeWidth = 12;
options.to.width = (100/value) * strokeWidth;

DaveData avatar Jan 17 '18 20:01 DaveData

Thanks @DaveData for a workaround example. Here's what worked for me:

var value = 0.2 // 0.0~1.0

// IE/Edge compatibility mode

if ((shape==='Circle' || shape==='SemiCircle') && options.strokeWidth >= 7) {

  // Start with stroke width 1 and animate up to value
  options.from.width = 1

  // Adjust stroke width to have same final value regardless of progress
  options.to.width = options.strokeWidth * (1 / value)

  // Linear easing to target right value above
  options.easing = 'linear'
}

eliot-akira avatar Sep 21 '18 15:09 eliot-akira

this does not work at all for me! I have strokewidth at 4 and it dosent matter if I change it upwards or downwards, it does not render at all. Have the lastest master. Dont know what the problem is..

CharbelIlias avatar Feb 05 '20 12:02 CharbelIlias

Not working for me in IE11. My stroke width is set to 6 but my bar isn't rendered at all in IE11. It seems like it has a problem with this:

            step: (state, bar) => {
                bar.path.setAttribute('stroke', state.color);
                var value = Math.round(bar.value() * 100) + "%";
                if (value === 0) {
                    bar.setText('');
                } else {
                    bar.setText(value);
                }

                bar.text.style.color = state.color;
            }

gillohner avatar Dec 31 '20 08:12 gillohner