Printing labels at specified location ?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Mudit Wahal

Printing labels at specified location ?

Post by Mudit Wahal » Thu Jun 13, 2002 5:19 pm

Hi DG and all,

Is there any function to print a label at a specified location ? Say, I need to print "A" at x=1, y=20 point in the chart.

Thanks

Mudit

David Gilbert

Re: Printing labels at specified location ?

Post by David Gilbert » Thu Jun 13, 2002 11:09 pm

Hi Mudit,

This has been discussed on occasions, but nothing has been developed. I think it would be fairly simple for the CategoryPlot and XYPlot classes to maintain a list of chart annotations. On the category plot, you could peg each annotation to a (category, value) location, and on the XYPlot you could use an x,y coordinate. Strings would be the easiest to add, but it could be generalised for shapes (arrows, lines etc), images, or whatever.

Anyone want to try writing something?

Regards,

DG

Mudit Wahal

Re: Printing labels at specified location ?

Post by Mudit Wahal » Fri Jun 14, 2002 4:05 pm

David,

I quickly extended HighLowRenderer to try something out. I printed a "1" or "0" below the low of the bar depending upon if the close was higher than open. So, I know that it can be done by extending/implementing a new renderer and a dataset which stores (label, x, y) information.

Thanks

Mudit

Locked