I read SVG docs but I can't find solution to this. How to draw in SVG ellipse gradient like in picture below?
I use svg radialGradient but it renders circle which is not I want. So next I draw ellipse and fill it with radialGradient and I end up with this:
I use svg mask to crop ellipse but it not working as I expected. Is there any way to achieve that?
Link to svg code: https://codesandbox.io/s/fancy-dew-skokw
<svg
tabindex="0"
focusable="true"
shape-rendering="optimizeSpeed"
viewBox="0 0 640 545"
style="border: 1px solid blue; width: 100%; height: 100%;"
>
<g id="text_7">
<rect
x="138"
y="455"
width="355"
height="60"
style=" mask: url('#mask_ellipse_7)'"
></rect>
<ellipse
cx="292"
cy="80"
rx="116"
ry="51"
transform="matrix(1,0,0,1,65,400)"
style="fill:url('#bg-ellipse-gradient_7'); "
></ellipse>
<text font-size="12" transform="matrix(1,0,0,1,65,400)">
<tspan x="75" y="67" dy="0" fill="#FF0000" fill-opacity="1">
Lorep ipsum - radial gradient
</tspan>
</text>
<defs>
<radialGradient
id="bg-ellipse-gradient_7"
fx="74%"
fy="37%"
>
<stop
stop-color="#00FFFF"
stop-opacity="1"
offset="0.000000"
></stop>
<stop
stop-color="#FFFF00"
stop-opacity="1"
offset="0.500000"
></stop>
<stop
stop-color="#000000"
stop-opacity="1"
offset="1.000000"
></stop>
</radialGradient>
</defs>
<defs>
<mask
id="mask_ellipse_7"
cx="292"
cy="80"
rx="116"
ry="51"
transform="matrix(1,0,0,1,65,400)"
style="fill:url('#bg-ellipse-gradient_7'); "
></mask>
</defs>
</g>
</svg>