I want to create a donut chart using an SVG circle element by setting stroke-dasharray
and varying stroke-dashoffset
. The SVG element needs to be rotated by 270 (or -90) degrees in order for the chart "bar" to start at the top. Here is the code:
The rotation angle is specified using the first number in transform="rotate(270, 80, 80)"
.
The problem is: when viewed in Safari on iOS 10 this rotation is not applied. In fact, setting 90, 180 or 270 degree rotation has no effect. The same angles but negative (for example -90) are also not applied.
Here is a screenshot of the above fiddle in Safari on iOS 10.0.1:
And here is the same fiddle in Safari on iOS 9.3.5:
As a workaround, I have found that using something like 270.1 degrees solves the problem, however I would like to know why 270 is not working and if there is a better way of dealing with it.