d3 autospace overlapping tick labels

前端 未结 3 827
轻奢々
轻奢々 2021-02-14 10:19

Is there a way in d3 to not draw overlapping tick labels? For example, if I have a bar chart, but the bars are only 5 pixels wide and the labels are 10 pixels wide, I end up wit

3条回答
  •  星月不相逢
    2021-02-14 10:56

    could you try something mentioned in this thread, specifically this example so that the labels are pushed up/down/out of the way so that they all may be fitted in. This requires using a seperate forces, one for the nodes and another for the labels themselves.

提交回复
热议问题