Annotation in barcharts (Y-value)

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
cortesino
Posts: 10
Joined: Mon Aug 11, 2008 7:31 pm

Annotation in barcharts (Y-value)

Post by cortesino » Thu Aug 14, 2008 9:38 am

Hello, i'm search this in forum but...

In my chart there are some horizontal bars but some of them are empty and I need fill this with labels. I use for this XYPlot, XYBarRenderer and XYIntervalSeriesCollection and I think create this labels with Annotation.

My problem is in obtain y-value for create a annotation
new XYTextAnnotation("ANNOTATION", (double) time.getFirstMillisecond(), Y-VALUE)

Anyone know how to do it?

Thanks!

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 Aug 14, 2008 8:58 pm

You'll need to use the y-value from your dataset for whichever bar you want the label to appear in.
David Gilbert
JFreeChart Project Leader

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

cortesino
Posts: 10
Joined: Mon Aug 11, 2008 7:31 pm

Post by cortesino » Mon Aug 18, 2008 5:22 pm

Thanks!!

Locked