In my project i am using one <image>
inside <svg>
to load image inside one circle i have referred bellow link
its working fine and they are using .png image, but i want to give one .svg(sprite image) so when i tried bellow code the full sprite image is loading, how i will show a single image from that sprite image.
In my same project i used sprite image with <div>
like this
background: url('../../Images/slice_01.svg') 38% 16%/ 488px 79px no-repeat;
with its working fine because by using bellow portion
38% 16%/ 488px 79px no-repeat
we can show single image from that sprite but in <image>
there is href is present instead of url so i tried
.attr("href", "http://localhost:62706/Images/slice_01.svg");
like this it will load that full image but where i will give this position in <href>
to show a particular image.
If there is any solution for this???
My sprite image is slice_01.svg
My design is
<svg id="graph" width="100%" height="400px">
<defs>
<pattern id="image" x="0%" y="0%" height="100%" width="100%"
viewBox="0 0 512 512">
<image href="http://localhost:62706/Images/slice_01.svg" x="0%" y="0%" width="512" height="512" ></image>
</pattern>
</defs>
<circle id="sd" class="medium" cx="5%" cy="40%" r="5%" fill="url(#image)" stroke="lightblue" stroke-width="0.5%" />
</svg>
here the problem is it will load that full image.From that i want to give position values to show a particular image(like i did with <div>
).But in <href>
we cant give that position.