我是SVG的新手。我想知道在SVG代码中,我可以使用哪个属性来添加椭圆元素的轮廓/边框? 事实上,我正在尝试使用SVG和jQuery制作一个交互式图表,因此当事件发生时,我需要让某些选定的椭圆元素显示特定颜色(如深红色)的实心轮廓。我想知道如何完成这个操作。
谢谢!
我是SVG的新手。我想知道在SVG代码中,我可以使用哪个属性来添加椭圆元素的轮廓/边框? 事实上,我正在尝试使用SVG和jQuery制作一个交互式图表,因此当事件发生时,我需要让某些选定的椭圆元素显示特定颜色(如深红色)的实心轮廓。我想知道如何完成这个操作。
谢谢!
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
width="100%" height="100%">
<ellipse cx="300" cy="80" rx="100" ry="50"
fill="yellow" stroke="purple" stroke-width="2"/>
</svg>
您是指椭圆边缘为紫色吗?还是说您需要在椭圆周围加一个方形边框,需要单独执行以下操作:
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
width="100%" height="100%">
<ellipse cx="300" cy="80" rx="100" ry="50" fill="yellow"/>
<rect x="200" y="30" width="200" height="100"
fill="none" stroke="purple" stroke-width="2"/>
</svg>
path {
fill: none;;
stroke: #646464;
stroke-width:1px
stroke-dasharray: 2,2;
stroke-linejoin: round;
}