我想为成绩创建一个虚线进度圈。我想使最大等级的破折号函数的长度。(例如:如果等级是 3.5/5,则破折号的长度为 24px)。
问题是第一个破折号(右上角的那个)不是想要的长度。
<svg xmlns="http://www.w3.org/2000/svg" [attr.viewBox]="_getViewBox()">
<!-- The grey circle plain for background-->
<path
#background
fill="none"
[style.stroke-width]="stroke"
[style.stroke]="'#EAEAEA'"
[attr.transform]="getPathTransform()"/>
<!-- The blue circle plain for progress -->
<path
#path
fill="none"
[style.stroke-width]="stroke"
[style.stroke]="resolveColor(color)"
[attr.transform]="getPathTransform()"/>
<!-- The white dashed circle for delimitation of dashes -->
<path
#dash
fill="none"
[style.stroke-width]="stroke"
[style.stroke]="'#ffffff'"
stroke-dasharray="4.3,23.7"
[attr.transform]="getPathTransform()"/>
</svg>
请注意,如果我将此值保留在最后一条路径上 > stroke-dasharray="4.3,23.7" 我会得到:
但这只是因为我遇到了将半径设为 70 的好值。因为如果我想更改它(例如使其成为最高等级的函数),我有这个:
我想要的是对破折号的数量和破折号的长度有一个连贯的值,我有点迷茫,我不知道该怎么做