Different color for item label with fallback position

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Post Reply
Posts: 1
Joined: Mon Jan 06, 2020 11:34 am
antibot: No, of course not.

Different color for item label with fallback position

Post by trangtrainam » Tue Jan 14, 2020 9:36 am

I got a bar chart with a white background. The item labels are positioned inside the bars and are also white colored. The bar itself is green. If the bar isn't big enough to display the item label inside, it falls back to a position outside of the bar.
The problem is, that the item label is white and the backround is white, too. So you cannot read the label text.

Is there an easy way to calculate if the item label will be drawn at the fallback position? Or maybe some fallback item label color? I tried to extend the BarRenderer but there are some private Methods that i can't call to calculate the "real" position.

Any ideas?

Post Reply