사용하여 원 stroke-dasharray
을 8 부분으로 나눌 필요가 있습니다.
2 * 3.14 * 20 = 125.6
125.6 / 8 = 15.7
stroke-dasharray="15.7, 15.7"
, 여기서 첫 번째 값은 대시의 길이이고 두 번째 값은 공백입니다.
<svg width="30%" height="30%" viewBox="0 0 120 120">
<!-- Outer circle -->
<circle class="default" cx="25" cy="25" r="24" fill="none" stroke="black" stroke-width="1"/>
<!-- The circle is divided into 4 sections -->
<circle class="default" cx="25" cy="25" r="20" fill="none" stroke="black"
stroke-width="8" stroke-dasharray="15.7, 15.7 "/>
<!--Inner circle -->
<circle class="default" cx="25" cy="25" r="16" fill="none" stroke="black" stroke-width="1"/>
</svg>
최신 정보
8 개 분야
<svg width="30%" height="30%" viewBox="0 0 120 120">
<!-- Outer circle -->
<circle class="default" cx="25" cy="25" r="24" fill="none" stroke="black" stroke-width="1"/>
<!-- The circle is divided into 4 sections -->
<circle class="default" cx="25" cy="25" r="20" fill="none" stroke="black"
stroke-width="8" stroke-dasharray="7.85"/>
<!--Inner circle -->
<circle class="default" cx="25" cy="25" r="16" fill="none" stroke="black" stroke-width="1"/>
</svg>
@enxaneta 주석으로
대시 높이는 스트로크 너비입니다. 따라서 스트로크 너비 = 반경 / 5를 설정할 수 있습니다.
stroke-width="4"
대시 사이의 간격을 투명하지 않고 흰색으로 채우는 방법 : 흰색 테두리가있는 다른 원과 점선 아래에 동일한 획 너비를 그립니다.
두 번째 원 추가
<circle class="gold" cx="25" cy="25" r="20" fill="none" stroke="gold"
stroke-width="4" stroke-dasharray="7.85" />
다른 색상을 추가 할 수있는 노란색 섹터를 추가했습니다.
<svg width="360" height="360" viewBox="0 0 120 120">
<circle class="gold" cx="25" cy="25" r="20" fill="none" stroke="gold"
stroke-width="4" stroke-dasharray="7.85" />
<circle class="black" cx="25" cy="25" r="20" fill="none" stroke="black"
stroke-width="4" stroke-dasharray="7.85" stroke-dashoffset="7.85"/>
</svg>
<svg width="360" height="360" viewBox="0 0 120 120">
<circle class="gold" cx="25" cy="25" r="20" fill="none" stroke="gold"
stroke-width="4" troke-dasharray="7.85" />
<circle class="black" cx="25" cy="25" r="20" fill="none" stroke="black"
stroke-width="4" stroke-dasharray="7.85" stroke-dashoffset="7.85"/>
</svg>
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다