Linha de meta (goal line)

Discussion about JFreeChart related to stockmarket charts.
Locked
Guest

Linha de meta (goal line)

Post by Guest » Wed Feb 15, 2006 12:48 pm

Pessoal,
Alguém sabe como eu crio um gráfico com linha de meta e label nos eixos?

Exemplo do gráfico que eu estou conseguindo gerar:
http://www.jeanjmichel.kit.net/mychar_original.jpg

Exemplo de como eu necessito que ele seja:
http://www.jeanjmichel.kit.net/mychar_goal.jpg


===============
Everybody,
someone know how can I create a char with goal line and label on axles?

Exemple of my the char that I just do:
http://www.jeanjmichel.kit.net/mychar_original.jpg

Exemple of how I need be it:
http://www.jeanjmichel.kit.net/mychar_goal.jpg


jmicheloz@hotmail.com for more details!
Thanks

develop
Posts: 296
Joined: Wed Mar 23, 2005 10:01 pm

Post by develop » Mon Mar 06, 2006 8:15 pm

i think you can do this by using XYLineAnnotation. find out lowest y (or where you want your line to be)

then find out lowest domain Axis using

double lowerBound = plot.getDomainAxis().getRange().getLowerBound();
double UpperBound = plot.getDomainAxis().getRange().getUpperBound();

then you can do this,

XYLineAnnotation ann = new XYLineAnnotation(lowerBound-10.0,y,upperBound + 10.0,y,new BasicStorke(1.0f),Color.red)

this should work and draw line.

Locked