discontinous line

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
consutes
Posts: 9
Joined: Fri Sep 14, 2007 6:06 pm

discontinous line

Post by consutes » Wed Sep 26, 2007 6:15 pm

Hi,

I need to set a disconituous line in my graph ( the value is a constant value.)

is this possible?


very thanks.

joolz
Posts: 56
Joined: Thu Nov 17, 2005 2:38 am
Location: Australia

Post by joolz » Thu Sep 27, 2007 4:28 am

Yes it is - instead of adding a number to the series, add a null

consutes
Posts: 9
Joined: Fri Sep 14, 2007 6:06 pm

Post by consutes » Fri Sep 28, 2007 2:58 pm

hi joolz

I think, there is something in my source that don't work, can you help me?

Code: Select all

//		List<Valor> valors=indicador.getValors();
//		for (Iterator iter = valors.iterator(); iter.hasNext();) {
//			Valor valor = (Valor) iter.next();
//			if (valor.data_valor!=null) {
//				if (!discontinua){
//					s3.addOrUpdate(new Month(valor.data_valor), mitjana);
//					discontinua = true;
//				}else {
//					s3.addOrUpdate(new Month(valor.data_valor), null);
//					discontinua = false;
//				}
//			}
//

joolz
Posts: 56
Joined: Thu Nov 17, 2005 2:38 am
Location: Australia

Post by joolz » Mon Oct 01, 2007 12:02 am

Without seeing the rest of the source, and without knowing what exactly didn't work, its very hard for me to help you.

That said, maybe try this:

Code: Select all

List<Valor> valors=indicador.getValors(); 
for (Iterator iter = valors.iterator(); iter.hasNext();)
{ 
   Valor valor = (Valor) iter.next(); 
   if (valor.data_valor!=null)
   { 
      s3.addOrUpdate(new Month(valor.data_valor), mitjana); 
   }
   else
   { 
      s3.addOrUpdate(new Month(valor.data_valor), null); 
   }
}

Locked