d3pie icon indicating copy to clipboard operation
d3pie copied to clipboard

Text Overlapping Issue

Open Kamalakshan opened this issue 10 years ago • 1 comments

We are Facing text overlapping issue if the data values are more similar to each other.

Test JSFiddle link to see the overlapping of text

http://jsfiddle.net/2uT7F/32/

This are my data values:

var data_values = [1, 1, 1,1,1,1, 1, 1, 48, 1, 100,1,1,1,1,100, 4]; var titles = ["aaaa","bbb","cccc", "Israel", "Netherlands", "Italy", "Uruguay", "USA", "United Kingdom", "Austria", "China","China0","China1","China2"]

Kamalakshan avatar Sep 04 '15 10:09 Kamalakshan

Hi @Kamalakshan, just to be clear: you're not using d3pie. This is all your own code, correct?

In d3pie I solved it in a very fussy way by checking coordinates and shifting the labels around to re-position them. But it's still not perfect. I would suggest looking into d3's forced layouts: https://github.com/mbostock/d3/wiki/Force-Layout

It I wrote d3pie today, I would probably have used that - or at least invested a lot more time to investigate it. It prevents collision of elements to ensure the desired spacing.

Good luck!

benkeen avatar Sep 04 '15 21:09 benkeen