【问题标题】:Correct orientation of a circular progress bar with SVG使用 SVG 正确定位圆形进度条
【发布时间】:2017-01-16 22:40:07
【问题描述】:

我正在使用 Sass 创建一个圆形进度条,使用以下代码,进度条从 3 点开始。我希望它从 12 点开始,但我不确定如何。

$radius: 50
$circumference: (3.14159265359 * (2 * $radius))

$percent: 85
$stroke_percentage: $circumference - (($percent / 100) * $circumference)

@keyframes circleIconProgress
  to
    stroke-dashoffset: $stroke_percentage

svg
  stroke-dasharray: $circumference
  stroke-dashoffset: $circumference

我该怎么做?谢谢。

【问题讨论】:

    标签: css svg sass


    【解决方案1】:

    您需要将圆圈逆时针旋转 90 度。例如:

    <circle ...  transform="rotate(-90, 75,75)"/>
    

    其中 (75,75) 是圆心的坐标。

    【讨论】:

      猜你喜欢
      • 2017-02-04
      • 2018-04-14
      • 2015-03-16
      • 1970-01-01
      • 2018-03-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多