我正在使用SVG创建图表。我已经用三个圆形元素创建了它,并添加了一个路径(三角形)以创建一个空白区域。但是我不知道如何隐藏底部几乎可见的细边框。也许我做错了什么?
这是我的演示:
`https://codepen.io/Groude/pen/VgmVvG`
以下是截图,以更好地理解我在谈论什么:
SVG:
<svg viewBox="0 0 32 32">
<defs></defs>
<circle
r="16"
cx="16"
cy="16"
class="circle--progress"
stroke-dasharray="100 100"
></circle>
<circle
r="16"
cx="16"
cy="16"
fill="none"
stroke="#3FC364"
stroke-dasharray="100 100"
></circle>
<circle
r="16"
cx="16"
cy="16"
fill="none"
stroke="#EDBB40"
stroke-dasharray="66 100"
></circle>
<circle
r="16"
cx="16"
cy="16"
fill="none"
stroke="#FF8832"
stroke-dasharray="33 100"
></circle>
<path d="M16 16 L100 50 L200 -50 Z" fill="white"></path>
</svg>
<div class="text">
<div class="text__percentage">100%</div>
<div class="text__description">Sentiment<br />score</div>
</div>
</div>
CSS
.wrapper {
position: relative;
width: 400px;
height: 400px;
padding: 20px 0;
margin: 0 auto;
}
svg {
width: 100%;
height: 100%;
border-radius: 50%;
transform: rotate(90deg);
}
circle {
fill: transparent;
stroke-width: 3;
}
.circle--progress {
fill: transparent;
stroke: #C4C4C4;
stroke-width: 32;
stroke-opacity: .25;
}
.text {
position: absolute;
z-index: 2;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-family: sans-serif;
text-align: center;
}
.text__percentage {
font-size: 60px;
font-weight: bold;
}
.text__description {
font-size: 18px;
font-weight: 500;
line-height: 16px;
}