HI GUYS, I HAVE A QUESTION.. NEED HELP?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
anhnn123
Posts: 3
Joined: Mon Jun 11, 2018 8:59 am
antibot: No, of course not.

HI GUYS, I HAVE A QUESTION.. NEED HELP?

Post by anhnn123 » Thu Jun 21, 2018 7:53 am

Hi,

I'm using JFreeChart 1.0.10. I have some Charts with multiple LineCharts. Because the LineCharts are drawn after each other, later LineCharts overlap SeriesItemLabels previously drawn (see attachment). Can I place all labels in the foreground?

My thoughts were:
The plot's render()-method calls the renderer's drawItem(), which calls drawItemLabe(). I could use a custom drawItem()-method, which doesn't call drawItemLabel(), and call drawItem() again, which only calls drawItemLabel() this time... Does that make any sense? Is there a better way?

https://www.flickr.com/photos/133085646 ... res/9bjUsm

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: HI GUYS, I HAVE A QUESTION.. NEED HELP?

Post by paradoxoff » Thu Jun 21, 2018 5:32 pm

I can't see the image.
But the idea of overwriting drawItem sounds ok. You could use most of the existing code. In addition, you need to check whether the series that is currently being drawn is the last series that the plot has, and if so, call drawItemLabel multiple times using all available series or row indices.

Locked