Labels overlapping on axis (domain, xy)

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
kalle
Posts: 36
Joined: Wed Dec 31, 2008 4:17 pm

Labels overlapping on axis (domain, xy)

Post by kalle » Thu Jan 08, 2009 6:44 am

When rendering labels on axis I get pretty often labels that overlay one another. This is pretty bad, since it's relatively easy to fix. You can either:
1) (HARD) have list of boxes (of taken items) and refuse to render on top of another.
2) (EASY) not fix the issue, but fix the visuals. Render with bg paint a box matching the size of the label.

#2 is what I've done in the past, but its really hard to remember all the tweaks between the library updates. So.. would this be possible to add into Jcommon, text rendering bit? or that (better idea) 1.2.0 would be expedited on this little thing. Or better yet, axis rendering would not be responsibility of the renderer, but someone else. It's hazardous to rely on the renderer, says that I really can just create xyitemrenderer and expect to get same results. Especially since it differs if the renderer is in index 0 or not.

Ideas?

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Jan 08, 2009 8:47 am

I'm confused when you say the axis labels rely on the XYItemRenderer for rendering...the labels are drawn by the axis itself in the drawTickMarksAndLabels() method. Maybe I misunderstood what you meant.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

kalle
Posts: 36
Joined: Wed Dec 31, 2008 4:17 pm

Post by kalle » Thu Jan 08, 2009 11:19 am

Oh, I must have misread it then.. :oops:

I recall I was reading xyplot markers, but I guess those are different things.

But issue still exists, it is rendering without clearing background. This is row 693 in date axis. (call for drawrotatedstring).

Locked