XYLinePresentation gaps

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Arkkimaagi
Posts: 25
Joined: Wed Jun 09, 2004 6:15 am
Location: Helsinki, Finland
Contact:

XYLinePresentation gaps

Post by Arkkimaagi » Thu Oct 26, 2006 12:02 pm

Lets consider that we have data like this about the current date. Timestamps are full, I just prefer not to write them here fully.

time = value
14:05 = 1
14:10 = 3
14:15 = 2
14:20 = null
14:25 = 1
14:30 = 2
14:35 = 3

When my series data contains datevalue that have null value on it, like 14:20 here, JFreeChart stops drawing the line at 14:15 and starts at 14:25 again.

This is logical and currect usually. But what if I'd want to draw a straight line from 14:15 at 2 to 14:25 at 1 totally skipping 14:20. How could I do this?

Is there some parameter to tweak, or should I run a for-loop to check if there's null value in this serie and pop that date out of my dataset?

Thanks in advance..
~ Arkkimaagi ~
Experto Credite

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 » Tue Oct 31, 2006 3:27 pm

If you want the line connected, then just check for a null value and don't add that item to the dataset.

Alternatively, you could modify the renderer to ignore null data values.
David Gilbert
JFreeChart Project Leader

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

Locked