Put label in the “center” of an SVG path

前端 未结 3 1295
萌比男神i
萌比男神i 2021-02-05 14:11

I\'m trying to draw a label on a polygon of an svg file. The problem I\'m facing is to find out roughly the center of this polygon to place the label, as the path\'s coordinates

3条回答
  •  日久生厌
    2021-02-05 14:22

    Insert a text tag inside the svg and position it by calculating the width and hight

     
        ............
        ............
    
       
            Text To Show
       
    
    

提交回复
热议问题