Label outside arc (Pie chart) d3.js

后端 未结 8 1428
日久生厌
日久生厌 2020-11-28 03:55

I\'m new to d3.js and I\"m trying to make a Pie-chart with it. I have only one problem: I can\'t get my labels outside my arcs... The labels are positioned with arc.centroid

8条回答
  •  青春惊慌失措
    2020-11-28 04:32

    I don't know if this helps but I was able to create arcs where I place text, both, on the arc and just outside it. In one case, where I place magnitudes of the arc within the arcs, I rotate the text on the arc to match the angle of the arc. In the other, where I place the text outside of the arc, it is simply horizontal. The code is located at: http://bl.ocks.org/2295263

    My Best,

    Frank

提交回复
热议问题