SVG animate only one clip-path element but not the rest - svg

I have the following code that works:
.clip-svg {
clip-path: url(#myClip);
animation: fadeInAnimation ease 3s;
}
#image-overlay {
position: absolute;
}
#image {
opacity: 0.035;
}
.container {
position: relative;
}
#overlay {
padding: 10px;
inset: 0;
position: absolute;
background-color: rgba(255, 255, 255, 0.4);
}
#keyframes fadeInAnimation {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
<div class="container">
<img id="image-overlay" class="clip-svg" src="https://miro.medium.com/v2/resize:fit:1400/0*kAOAT0_uC42E9V5l" />
<img src="https://miro.medium.com/v2/resize:fit:1400/0*kAOAT0_uC42E9V5l" id="image" />
</div>
<svg>
<defs>
<clipPath id="myClip" clipPathUnits="objectBoundingBox">
<polygon points="0,0 .4,0 .4,.4 0,.4"/>
<circle cx=".2" cy=".42" r=".04"/>
<circle cx=".4" cy=".2" r=".04"/>
<polygon points=".6,.6 1,.6 1,1 .6,1" />
<circle cx=".8" cy=".6" r=".04"/>
<circle cx=".6" cy=".8" r=".04"/>
<polygon points=".6,0 1,0 1,.4 .6,.4" />
<circle cx=".6" cy=".2" r=".04"/>
<circle cx=".8" cy=".4" r=".04"/>
<polygon points="0,.6 .4,.6 .4,1 0,1"/>
<circle cx=".2" cy=".6" r=".04"/>
<circle cx=".4" cy=".8" r=".04"/>
</clipPath>
</defs>
</svg>
It works fine
Here is the link to the CodePen:
https://codepen.io/marceltudor/pen/xxJBqRO
I'd like to animate only one of the four puzzle pieces not all of them.
I tried a direct reference by #id in svg and in polygon
.clip-svg {
clip-path: url(#myClip);
}
#myFirstSvg #polygon1 {
animation: fadeInAnimation ease 3s;
}
#image-overlay {
position: absolute;
}
#image {
opacity: 0.035;
}
.container {
position: relative;
}
#overlay {
padding: 10px;
inset: 0;
position: absolute;
background-color: rgba(255, 255, 255, 0.4);
}
#keyframes fadeInAnimation {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
<div class="container">
<img id="image-overlay" class="clip-svg" src="https://miro.medium.com/v2/resize:fit:1400/0*kAOAT0_uC42E9V5l" />
<img src="https://miro.medium.com/v2/resize:fit:1400/0*kAOAT0_uC42E9V5l" id="image" />
</div>
<svg id="myFirstSvg">
<defs>
<clipPath id="myClip" clipPathUnits="objectBoundingBox">
<polygon id = "polygon1" points="0,0 .4,0 .4,.4 0,.4"/>
<circle cx=".2" cy=".42" r=".04"/>
<circle cx=".4" cy=".2" r=".04"/>
<polygon points=".6,.6 1,.6 1,1 .6,1" />
<circle cx=".8" cy=".6" r=".04"/>
<circle cx=".6" cy=".8" r=".04"/>
<polygon points=".6,0 1,0 1,.4 .6,.4" />
<circle cx=".6" cy=".2" r=".04"/>
<circle cx=".8" cy=".4" r=".04"/>
<polygon points="0,.6 .4,.6 .4,1 0,1"/>
<circle cx=".2" cy=".6" r=".04"/>
<circle cx=".4" cy=".8" r=".04"/>
</clipPath>
</defs>
</svg>
I tried as well the tag in svg
.clip-svg {
clip-path: url(#myClip);
}
#image-overlay {
position: absolute;
}
#image {
opacity: 0.035;
}
.container {
position: relative;
}
#overlay {
padding: 10px;
inset: 0;
position: absolute;
background-color: rgba(255, 255, 255, 0.4);
}
#keyframes fadeInAnimation {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
<div class="container">
<img id="image-overlay" class="clip-svg" src="https://miro.medium.com/v2/resize:fit:1400/0*kAOAT0_uC42E9V5l" />
<img src="https://miro.medium.com/v2/resize:fit:1400/0*kAOAT0_uC42E9V5l" id="image" />
</div>
<svg>
<defs>
<clipPath id="myClip" clipPathUnits="objectBoundingBox">
<polygon points="0,0 .4,0 .4,.4 0,.4">
<animate id="animation1"
attributeName="opacity"
from="0" to="1" dur="1s"
begin="0s;animation2.end" />
<animate id="animation2"
attributeName="opacity"
from="1" to="0" dur="1s"
begin="animation1.end" />
</polygon>
<circle cx=".2" cy=".42" r=".04"/>
<circle cx=".4" cy=".2" r=".04"/>
<polygon points=".6,.6 1,.6 1,1 .6,1" />
<circle cx=".8" cy=".6" r=".04"/>
<circle cx=".6" cy=".8" r=".04"/>
<polygon points=".6,0 1,0 1,.4 .6,.4" />
<circle cx=".6" cy=".2" r=".04"/>
<circle cx=".8" cy=".4" r=".04"/>
<polygon points="0,.6 .4,.6 .4,1 0,1"/>
<circle cx=".2" cy=".6" r=".04"/>
<circle cx=".4" cy=".8" r=".04"/>
</clipPath>
</defs>
</svg>
But it does not animate the respective polygon.
Ideally I'd like to animate the group of the first polygon and the first two circles, but even to animate the first polygon I can't. Can you please help me on how to animate the first polygon, and just that one not all of the clip-path elements.
Thank you

Related

Reusing SVG elements while inserting different text?

I want to display balls with 1,2,3,4 inside. Can I use <use>? or I must duplicate the stone <g>?
#stone text {
fill: grey;
dominant-baseline: middle;
text-anchor: middle;
font-size: 0.33pt;
}
#pane {
background-color: yellow;
width: 100%;
height: 100%;
}
.stone-white {
fill: #F2F4F4;
}
.stone-black {
fill: #273746;
}
<svg id="pane" viewBox="0 0 22 22" preserveAspectRatio="none">
<defs>
<g id="stone">
<circle cx="0" cy="0" r="0.45" />
<text>333</text>
</g>
</defs>
<use href="#stone" class="stone-white" x="1" y="1"/>
<use href="#stone" class="stone-white" x="2" y="2"/>
<use href="#stone" class="stone-black" x="3" y="2"/>
<use href="#stone" class="stone-black" x="2" y="4"/>
</svg>

How to make a circular bullet point containing a number where the number text must scale

So I have been asked to make a section number that is constructed as a non-filled circle with a 2px border containing a number. The range of the numbers is 1 to 999.
As you can see from the example below, it looks pleasing at one & two digit section numbers, but when we hit three digits the number is clipped.
My thinking is that there needs to be a process where the text is drawn, measured, then scaled to fit into the target space inside the circle, where the target space is effectively a square rect 60% of the diameter of the circle.
However, no JS is allowed in the solution.
I thought it might be possible using SVG and its scaling capabilities via the 'preserveAspectRatio' parameter. However the image above is a screen grab of my SVG results. Working snippet below.
My intention with the code was to have the inner SVG containing the text resize proportionally so that it would fit the width of the parent, with the height set to auto so that it would change in proportion.
Can anyone tell me where I am going wrong?
PS. I am using Chrome on PC to test.
Note: In the following snippet the output looks like the image, so 8, then 88, then 888. The markup is the same for each case - only the text content changes.
body {
padding: 20px;
overflow: hidden;
background-color: #f0f0f0;
}
.counterDiv {
width: 44px;
max-width: 44px;
min-width: 44px;
height: 44px;
max-height: 44px;
min-height: 44px;
margin: 0;
padding: 0;
}
svg {
width: 100%;
height: 100%;
}
text {
font: normal normal 18pt Helvetica, Arial, Verdana;
}
<div class='counterDiv' style='position: relative;'>
<svg viewbox="0 0 44 44">
<g>
<circle cx="22" cy="22" r="20" stroke="#cd1041" stroke-width="2px" fill-opacity="0" />
<svg viewBox="0 0 100 auto" x="20%" width="60%" preserveAspectRatio="xMidYMid meet">
<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle" fill="#cd1041" dy=".1em">8</text>
</svg>
</g>
</svg>
</div>
<div class='counterDiv' style='position: relative;'>
<svg viewbox="0 0 44 44">
<g>
<circle cx="22" cy="22" r="20" stroke="#cd1041" stroke-width="2px" fill-opacity="0" />
<svg viewBox="0 0 100 auto" x="20%" width="60%" preserveAspectRatio="xMidYMid meet">
<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle" fill="#cd1041" dy=".1em">88</text>
</svg>
</g>
</svg>
</div>
<div class='counterDiv' style='position: relative;'>
<svg viewbox="0 0 44 44">
<g>
<circle cx="22" cy="22" r="20" stroke="#cd1041" stroke-width="2px" fill-opacity="0" />
<svg viewBox="0 0 100 auto" x="20%" width="60%" preserveAspectRatio="xMidYMid meet">
<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle" fill="#cd1041" dy=".1em">888</text>
</svg>
</g>
</svg>
</div>
A posible solution would be using textLength and lengthAdjust. The lengthAdjust attribute controls how the text is stretched into the length defined by the textLength attribute. One inconvinient would be that the 1 digit numbers would be stretched.
An alternative solution would be using a smaller font size.
Also you may want to use javascript to target only the 3 digit text elements.
body {
padding: 20px;
overflow: hidden;
background-color: #f0f0f0;
}
.counterDiv {
width: 44px;
max-width: 44px;
min-width: 44px;
height: 44px;
max-height: 44px;
min-height: 44px;
margin: 0;
padding: 0;
}
svg {
width: 100%;
height: 100%;
}
text {
font: normal normal 18pt Helvetica, Arial, Verdana;
}
<div class='counterDiv' style='position: relative;'>
<svg viewbox="0 0 44 44">
<g>
<circle cx="22" cy="22" r="20" stroke="#cd1041" stroke-width="2px" fill-opacity="0" />
<svg viewBox="0 0 100 auto" x="20%" width="60%" preserveAspectRatio="xMidYMid meet">
<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle" fill="#cd1041" dy=".1em" textLength="25" lengthAdjust="spacingAndGlyphs">8</text>
</svg>
</g>
</svg>
</div>
<div class='counterDiv' style='position: relative;'>
<svg viewbox="0 0 44 44">
<g>
<circle cx="22" cy="22" r="20" stroke="#cd1041" stroke-width="2px" fill-opacity="0" />
<svg viewBox="0 0 100 auto" x="20%" width="60%" preserveAspectRatio="xMidYMid meet">
<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle" fill="#cd1041" dy=".1em" textLength="25" lengthAdjust="spacingAndGlyphs">88</text>
</svg>
</g>
</svg>
</div>
<div class='counterDiv' style='position: relative;'>
<svg viewbox="0 0 44 44">
<g>
<circle cx="22" cy="22" r="20" stroke="#cd1041" stroke-width="2px" fill-opacity="0" />
<svg viewBox="0 0 100 auto" x="20%" width="60%" preserveAspectRatio="xMidYMid meet">
<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle" fill="#cd1041" dy=".1em" textLength="25" lengthAdjust="spacingAndGlyphs">888</text>
</svg>
</g>
</svg>
</div>
Not for OP,
but for all those SVG loving people who have an inner-guide (or sensible boss)
that tells them: "JavaScript is fine, when applied with common sense"
customElements.define("svg-counter", class extends HTMLElement {
connectedCallback() {
this.render();
}
render(
val = this.getAttribute("value") || "888",
color = "green",
circlestrokewidth = 4,
circlestroke = "red",
circlefill = "none"
){
let id = "P" + (new Date() / 1); // uniqueid
let singleDigit = val.length == 1;
this.innerHTML = `
<svg viewbox="0 0 100 100">
<circle cx="50" cy="50" r="${50-circlestrokewidth}" stroke="${circlestroke}"
fill="${circlefill}" stroke-width="${circlestrokewidth}"/>
<path id="${id}" pathLength="100" d="M0 60H100" stroke="none"/>
<text transform="scale(${singleDigit?1:.7})" transform-origin="50 50">
<textPath href="#${id}" method="stretch"
textlength="100" lengthAdjust="${singleDigit?"":"spacingAndGlyphs"}"
startoffset="50" text-anchor="middle" dominant-baseline="middle"
font-family="Helvetica"
fill="${color}" font-size="${100}px">${val}</textPath>
</text>
</svg>`;
}
});
svg {
width: 20%;
}
<svg-counter value="8"></svg-counter>
<svg-counter value="88"></svg-counter>
<svg-counter value="888"></svg-counter>
<svg-counter value="8888"></svg-counter>
Alas FireFox has some issues, slight tweaked version to make it work in FireFox:
Alas I have a boss who says "We don't care about FireFox customers"
customElements.define("svg-counter", class extends HTMLElement {
connectedCallback() {
this.render();
}
render(
val = this.getAttribute("value") || "888",
color = "green",
circlestrokewidth = 4,
circlestroke = "red",
circlefill = "none"
){
let id = "P" + (new Date() / 1) + val.length; // uniqueid
let singleDigit = val.length == 1;
this.innerHTML = `
<svg viewbox="0 0 100 100">
<circle cx="50" cy="50" r="${50-circlestrokewidth}" stroke="${circlestroke}"
fill="${circlefill}" stroke-width="${circlestrokewidth}"/>
<path id="${id}" pathLength="100" d="M0 55H100" stroke="blue"/>
<text transform="scale(${[0,1.7,1.2,.9,.7][val.length]})" transform-origin="50 50">
<textPath href="#${id}" method="stretch"
textlength="100" lengthAdjust="${singleDigit?"":"spacingAndGlyphs"}"
startoffset="50" text-anchor="middle" dominant-baseline="middle"
font-family="Helvetica"
fill="${color}" font-size="50px">${val}</textPath>
</text>
</svg>`;
}
});
svg {
width: 20%;
}
<svg-counter value="8"></svg-counter>
<svg-counter value="88"></svg-counter>
<svg-counter value="888"></svg-counter>
<svg-counter value="8888"></svg-counter>

css/html- to create a circle with a hole in the bottom

enter image description here
I wanna make circle chart like this.
below is my code.
If I invert up and down in that code, i get the shape you want.
But what I really want is a graph with the yellow graph pointing further to the right. How do I adjust the spacing?
Please help me
<svg width="4.5rem" height="4.5rem" viewBox="0 0 40 40">
<circle class="pieSegment segment1" cx="20" cy="20" r="15.915494309189533" fill="transparent" stroke="#1a0d1c" stroke-dashoffset="11" stroke-dasharray="74" stroke-width="5"></circle>
<circle class="pieSegment segment3" cx="20" cy="20" r="15.915494309189533" fill="transparent" stroke="#e9ad61" stroke-dashoffset="14" stroke-dasharray="25 75" stroke-width="5"></circle>
</svg>
Edit (missed the previous answer by #jeremy-denis also using pathLength)
Here is another approach also using pathLength value:
See also MDN Docs: pathLength
example horse shoe gauge
let progress = document.querySelector("#progress");
let svgGauges = document.querySelectorAll(".svgGauge");
let gauges = document.querySelectorAll(".gaugePercent");
let percentText = document.querySelector(".percentText");
progress.addEventListener("change", function(e) {
let percent = e.target.value;
if (svgGauges.length) {
svgGauges.forEach(function(item, i) {
let currentGauge = svgGauges[i];
let gauge = currentGauge.querySelector(".gaugePercent");
let dashGap = gauge.getAttribute("stroke-dasharray").split(" ")[1];
// console.log(gauge);
gauge.setAttribute("stroke-dasharray", percent + " " + dashGap);
gauge.setAttribute("style", "animation-fill-mode: none");
percentText.textContent = percent;
});
}
});
.gaugeWrap {
display: inline-block;
width: 10rem;
}
.layout {
width: 50%;
margin: 0 auto;
display: flex;
justify-content: center;
}
.txt-cnt {
text-align: center;
}
.circle {
transition: 0.3s;
stroke-width: 15;
}
.linecap-round .circle {
stroke-linecap: round;
shape-rendering: geometricPrecision;
}
.linecap-round .circle[stroke-dasharray^="0 "] {
stroke-linecap: unset;
}
<p class="txt-cnt">Progress (<span class="percentText">50</span> %) <input id="progress" style="width:100px" type="range" min="0" max="100" step="10" value="50" />
</p>
<div class="layout">
<div class="gaugeWrap">
<p>horse shoe gauge 270°</p>
<svg class="svgGauge linecap-round" viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" transform="scale(-1 1) rotate(-225) ">
<circle class="circle gaugeBG" id="gaugeBG" cx="50%" cy="50%" r="45" pathLength="133.333" fill="none" stroke="#000" stroke-dasharray="100 100" />
<circle class="circle gaugePercent " id="gauge" cx="50%" cy="50%" r="45" pathLength="133.333" fill="none" stroke-dasharray="50 133.333" stroke="#e9ad61" />
</svg>
</div>
<div class="gaugeWrap">
<p>Semi-circle gauge 180°</p>
<svg class="svgGauge linecap-round" viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" transform="scale(-1 1) rotate(-180)">
<circle class="circle gaugeBG " id="gaugeBG" cx="50%" cy="50%" r="45" pathLength="200" fill="none" stroke="#000" stroke-dasharray="100 200" />
<circle class="circle gaugePercent" id="gauge" cx="50%" cy="50%" r="45" pathLength="200" fill="none" stroke-dasharray="50 200" stroke="#e9ad61" />
</svg>
</div>
<div class="gaugeWrap">
<p>Full-circle gauge 360°</p>
<svg class="svgGauge" viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" transform="rotate(-90)">
<circle class="circle gaugeBG" id="gaugeBG" cx="50%" cy="50%" r="45" pathLength="100" fill="none" stroke="#000" stroke-dasharray="100 100" />
<circle class="circle gaugePercent" id="gauge" cx="50%" cy="50%" r="45" pathLength="100" fill="none" stroke-linecap="butt" stroke-dasharray="50 100" stroke="#e9ad61" />
</svg>
</div>
</div>
Your example has approximately a 270° range (3/4 of 360°).
By setting pathLengthto 133 (360/270*100) we change the computation of the dash lengths.
Since we don't use the complete circumference of the circle (see the full circle example with pathLength=100) we increase the pathlength to make this 3/4 segment to have a length of 100 units.
We can set the first stroke-dasharray value e.g. to 50 (display 50% progress).
The 2nd value 133 ensures the dash gap is large enough to fill the rest of the circle gauge.
To make the horse shoe gauge stand upright we need to calculate a rotation like this:
(360 + 270)/2 - 90 = -225
So we can rotate the parent svg by setting the transform attribute to
transform="scale(-1 1) rotate(-225)"
Gauge generator pen
an idea can be to use pathLength="100" to your circle
that allow you to give a percent in the attribute stroke-dashoffset with 100% - {percent of circle to fill}
then we can imagine rotate the circle to the correct shape
#mySvg {
transform: rotate(-125deg) scaleX(-1);
}
to round the border of your line you can use
stroke-linecap: round;
#mySvg {
transform: rotate(-125deg) scaleX(-1);
}
#mySvg circle {
stroke-linecap: round;
shape-rendering: geometricPrecision;
}
<svg id="mySvg" width="4.5rem" height="4.5rem" viewBox="0 0 40 40">
<circle class="pieSegment segment1" cx="20" cy="20" r="15.915494309189533" fill="transparent" stroke="#1a0d1c" stroke-dashoffset="20" stroke-dasharray="100" stroke-width="5" pathLength="100"></circle>
<circle class="pieSegment segment3" cx="20" cy="20" r="15.915494309189533" fill="transparent" stroke="#e9ad61" stroke-dashoffset="80" stroke-dasharray="100" stroke-width="5" pathLength="100"></circle>
</svg>

SVG moves out of position when screen size changes or doesn't scale

I've created an SVG and put the width as a percentage because I want it to resize to fit different screen widths, but when I resize the screen, the svg moves up and down and doesn't move left/right to stay in the centre. If I use pixels instead of percentages, it doesn't resize with the screen.
Preview didn't work on here so here's the codepen link
.
HTML
<svg height="100%" width="100%" id="main">
<circle class="graph line line-1" cx="50%" cy="50%" r="25%" stroke-width="5%" stroke="#f1c40f" fill="none" />
<circle class="graph line line-2" cx="50%" cy="50%" r="20%" stroke-width="5%" stroke="#e67e22" fill="none" />
<circle class="graph line line-3" cx="50%" cy="50%" r="15%" stroke-width="5%" stroke="#00c0df" fill="none" />
</svg>
CSS
#main {
padding: 100px 0;
margin-top: 100px;
height: 200px;
background-color: pink;
}
.graph {
transform: rotate(270deg);
}
.graph.line {
transform-origin: center;
stroke-dasharray: 160%;
animation: graph 1.5s ease-in-out infinite alternate;
}
#keyframes graph {
from {
stroke-dashoffset: 160%;
}
to {
stroke-dashoffset: 90%;
}
}
That's what viewBox is for. With a viewBox, you establish a local coordinate system, which scales with your image. In your svg you simply use your local coordinates, and the image scales to any size...
#main {
position:absolute;
top:0px;left:0px;
right:0px;bottom:0px;
background:pink
}
.graph {
transform: rotate(270deg);
}
.graph.line {
transform-origin: center;
stroke-dasharray: 160%;
animation: graph 1.5s ease-in-out infinite alternate;
}
#keyframes graph {
from {
stroke-dashoffset: 160%;
}
to {
stroke-dashoffset: 90%;
}
}
<svg viewBox="0 0 100 100" id="main">
<circle class="graph line line-1" cx="50" cy="50" r="25" stroke-width="5" stroke="#f1c40f" fill="none" />
<circle class="graph line line-2" cx="50" cy="50" r="20" stroke-width="5" stroke="#e67e22" fill="none" />
<circle class="graph line line-3" cx="50" cy="50" r="15" stroke-width="5" stroke="#00c0df" fill="none" />
</svg>

circular arc paths with svg

I am pretty new to SVG and wanted to ask for a best approach to the following design:
I believe SVG is the way to go here since I need hover and click effects on each of the red arc pieces. These values and this design are essentially hardcoded and will not change. Are there any tools / libraries (D3 or Raphael) that would make this easier for me?
Thanks In Advance.
meetamit's suggestion is a good one. Or you could look into the 'sector' method shown here:
Half circle using raphael
You don't really need d3 or even an editor. It's a design that is easy to code by hand.
I was bored, so I whipped this up in about 10 minutes.
document.getElementById("band4").addEventListener("click", function(e) {
alert("50+");
}, false);
document.getElementById("band3").addEventListener("click", function(e) {
alert("20-50");
}, false);
document.getElementById("band2").addEventListener("click", function(e) {
alert("10-20");
}, false);
document.getElementById("band1").addEventListener("click", function(e) {
alert("Less than 10");
}, false);
svg {
position: absolute;
top: 0px;
}
circle.band {
fill: #a20c3e;
}
circle.band:hover {
fill: #ca3f5e;
}
text {
font-family: sans-serif;
font-size: 12px;
font-weight: bold;
fill: white;
}
tspan.sup {
font-size: 6px;
}
text.sub {
font-size: 5px;
font-weight: normal;
}
<img src="http://lorempixel.com/400/200/" width="100%"/>
<svg viewBox="-100 -100 200 100">
<defs>
<mask id="target">
<rect x="-100" width="100%" height="100%" fill="black"/>
<circle r="97" fill="white"/>
<circle r="77" fill="black"/>
<circle r="74" fill="white"/>
<circle r="54" fill="black"/>
<circle r="51" fill="white"/>
<circle r="31" fill="black"/>
<circle r="28" fill="white"/>
</mask>
</defs>
<circle id="band4" class="band" r="98" mask="url(#target)"/>
<circle id="band3" class="band" r="75" mask="url(#target)"/>
<circle id="band2" class="band" r="52" mask="url(#target)"/>
<circle id="band1" class="band" r="29" mask="url(#target)"/>
<text y="-82" text-anchor="middle" pointer-events="none">50<tspan class="sup" font-size="50%" dy="-0.7em">+</tspan></text>
<text y="-59" text-anchor="middle" pointer-events="none">20-50</text>
<text y="-36" text-anchor="middle" pointer-events="none">10-20</text>
<text y="-17" text-anchor="middle" class="sub" pointer-events="none">Less than</text>
<text y="-6" text-anchor="middle" pointer-events="none">10</text>
</svg>

Resources