Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent label overlap in code

Status
Not open for further replies.

evalesthy

Programmer
Oct 27, 2000
513
US
I am plotting a graph using code. As part of that I am writing out the label for each graph line at the max value point.

Me.CurrentY = lngY2
Me.CurrentX = lngX2
Me.FontSize = 8
Me.FontBold = True
Me.Print rst(x).Name

If two lines intersect at their max value the labels would be printed over each other. Can anyone think of a way to detect if a plotted position has already been used.

I know it gets more complicated as 3 or more labels could overlap - but I'll worry about that later.
 
You might need an array to store the currentx and currenty so that you can search back through it to find "near" values. This would allow you to increase or decrease one of the values to reposition the label.


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top