Series break in a line chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
ccapano
Posts: 12
Joined: Mon Sep 12, 2005 9:22 pm
Location: Frederick, Maryland
Contact:

Series break in a line chart

Post by ccapano » Tue May 02, 2006 3:44 pm

Is there a way I can make a series break in a line chart (not connect the data points at certain times) ... Passing in Double.NaN causes Java2D problems.

Thanks

dhchou
Posts: 138
Joined: Tue Jul 05, 2005 11:01 pm

Post by dhchou » Tue May 02, 2006 9:47 pm

You simply add a data point that has the x value of the point you want to skip and null for the missing y value. In the plot, points with null values will show up as gaps in the plot.

Daniel

kash22
Posts: 5
Joined: Thu May 04, 2006 10:30 am

Post by kash22 » Thu May 04, 2006 10:47 am

And what to do if i dont want the breaks for missing points..?

http://www.jfree.org/phpBB2/viewtopic.p ... ct+missing
kash

Jyothy
Posts: 17
Joined: Fri Mar 24, 2006 6:46 am

Post by Jyothy » Tue May 30, 2006 12:49 pm

Hi Daniel,

As you said values as null would be shown as balnk in line graph,
But in my case i want to show gap when data is not collected( ie not stored in database ) for certain period. so there would be no data in database in this particular period and i need to show it as blank.


Thanks
Jyothy

dhchou
Posts: 138
Joined: Tue Jul 05, 2005 11:01 pm

Post by dhchou » Wed May 31, 2006 8:54 pm

Let me clarify what I said. When there is a domain value (usually horizontal axis) but no range value (usually vertical) axis in a XYPlot, then JFreeChart will render a gap in the line.

If you do no have data for a particular period, you will know the domain value. Just use null as the range value for those cases.

Daniel

Locked