我正在尝试更改灰色区域的宽度并根据从 1 到 100 的某个值移动圆形图层。
我将 D3.js 与 SVG 图像一起使用。下面是 svg 图像的代码,但我无法更改宽度,因为路径标签没有任何直接属性可以做到这一点。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Creator: CorelDRAW -->
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="2480px" height="3508px" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
viewBox="0 0 2480 3507.43">
<defs>
<style type="text/css">
<![CDATA[
.str0 {stroke:#989B9F;stroke-width:2.08354}
.str1 {stroke:#989B9F;stroke-width:2.08354}
.str2 {stroke:#989B9F;stroke-width:2.08354}
.fil0 {fill:url(#id0)}
.fil1 {fill:url(#id1)}
.fil2 {fill:url(#id2)}
]]>
</style>
<linearGradient id="id0" gradientUnits="userSpaceOnUse" x1="301.84" y1="146.253" x2="301.84" y2="122.891">
<stop offset="0" style="stop-color:#D7D9DC"/>
<stop offset="1" style="stop-color:white"/>
</linearGradient>
<linearGradient id="id1" gradientUnits="userSpaceOnUse" x1="191.679" y1="122.891" x2="191.679" y2="146.253">
<stop offset="0" style="stop-color:#D7D9DC"/>
<stop offset="1" style="stop-color:#42494C"/>
</linearGradient>
<linearGradient id="id2" gradientUnits="userSpaceOnUse" x1="259.354" y1="155.487" x2="259.354" y2="113.657">
<stop offset="0" style="stop-color:#D7D9DC"/>
<stop offset="1" style="stop-color:white"/>
</linearGradient>
</defs>
<g id="Layer_x0020_1">
<metadata id="CorelCorpID_0Corel-Layer"/>
<path class="fil0 str0" d="M470.747 146.253l-337.814 0c-6.42438,0 -11.6808,-5.25642 -11.6808,-11.6808l0 0c0,-6.42438 5.25642,-11.6808 11.6808,-11.6808l337.814 0c6.42438,0 11.6808,5.25642 11.6808,11.6808l0 0c0,6.42438 -5.25642,11.6808 -11.6808,11.6808z"/>
</g>
<g id="Layer_x0020_2">
<metadata id="CorelCorpID_1Corel-Layer"/>
<path class="fil1 str1" d="M132.933 122.891l117.492 0c6.42438,0 11.6808,5.25642 11.6808,11.6808l0 0c0,6.42438 -5.25642,11.6808 -11.6808,11.6808l-117.492 0c-6.42438,0 -11.6808,-5.25642 -11.6808,-11.6808l0 0c0,-6.42438 5.25642,-11.6808 11.6808,-11.6808z"/>
</g>
<g id="Layer_x0020_3">
<metadata id="CorelCorpID_2Corel-Layer"/>
<circle class="fil2 str2" cx="259.353" cy="134.572" r="20.9144"/>
</g>
</svg>