How to set labels dinamically

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

How to set labels dinamically

Post by Marcial Atienzar » Fri Feb 14, 2003 10:24 am

Hello,

I take data from a BD. I need to know how to set labels inside the image. Is to say, I use bar to represent the image, and I need to put labels on top of this bars. Is it possible?

A lot of thanks,

Marcial Atienzar

Arnaud

Re: How to set labels dinamically

Post by Arnaud » Fri Feb 14, 2003 10:51 am

Hello,

You can use the setValueLabelsVisible(true) so that the values are displayed inside the chart, on the datapoints.

The method is not implemented in each renderer.... I hope to provide some changes in order to widen the already existing work - perhaps end of next week.

However, I only planned to display values in a first time. I wondered to if it was more interesting to display kind of "tooltips"... but as I need a quick solution with values so I'll first write that !

So, the solution would perhaps be to write kind of ValueLabelGenerator class as the ToolTipGenerator, with some default labelTypes :
- valueOnly
- value + custom Text
- series value
- series category value
- ...
Any suggestion is welcome.

Regards,
Arnaud

Locked