I render the SVG image dynamically and create rotated text. If the rotated text overlaps with other text, I need to delete this text. But I can't measure the rotated text to create borders and check with the next area of ββthe label text.
I created 3 SVG elements for explanation.
- SVG-1 Displays overlapping text.
- SVG-2 Shows rotated text with overlapping (Angle-10)
- SVG-3 Shows rotated text without overlapping (Angle-50)
I will rotate the text at any angle dynamically. If it overlaps while the text is being rotated, I need to programmatically delete this overlapping text.
Script Link
<div style=" width: 150px;height: 150px;"> <svg style="width: 250px; height: 144px; border: solid black 1px;"> <text id="XLabel_0" x="75" y="30">Sprint 13_March_2015</text> <text id="XLabel_1" x="100" y="30">DT_Apr2015_Sprint13</text> </svg> <svg style="width: 250px; height: 144px; border: solid black 1px;"> <text id="Label_0" x="75" y="30" transform="rotate(10, 75, 34.5)">Sprint 13_March_2015</text> <text id="XLabel_1" x="100" y="30" transform="rotate(10, 100, 34.5)">DT_Apr2015_Sprint13</text> </svg> <svg style="width: 250px; height: 144px; border:solid black 1px;"> <text id="XLabel_0" x="75" y="30" transform="rotate(50,94,34.5)">Sprint 13_March_2015</text> <text id="XLabel_1" x="100" y="30" transform="rotate(50,123,61)" >DT_Apr2015_Sprint13</text> </svg> </div>
Can anyone suggest a solution?
source share