I have a telerik RadHtmlChart which generates some svg for a graph.
The graph currently looks like this:
Each circle has a label associated with it. Unfortunately they tend to bunch up and overlap each other.
I'd like to move the text elements up/down with javascript so they don't all overlap but I'm not sure the best way to go about it.
I wrote some code to loop through the <text>
svg elements but am stuck on the overlap detection/moving part.
var svg = document.getElementsByTagName("svg")[0];
var svgLabels = svg.getElementsByTagName("text");
for (i = 0; i < svgLabels.length; i++) {
//Check for overlap, move if necessary
}
Is there some way to do this nicely?