Noncontiguous LineAndShapeRenderer

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
chunkyks
Posts: 8
Joined: Sat Sep 24, 2011 2:56 am
antibot: No, of course not.

Noncontiguous LineAndShapeRenderer

Post by chunkyks » Thu Nov 07, 2013 8:54 pm

I'm using a LineAndShapeRenderer on a chart, with both lines and points enabled. The X Axis is a DateAxis, and points are either every month, or every three months. Sometimes a month [or quarter] is skipped, and I don't have a point for it.

What I want is to *not* draw lines between points, if the point is skipped. Previously I was using gnuplot, and would add a blank row in the input where I wanted the line to become disjoint; gnuplot would draw every point, with lines between all the points that didn't have a blank line between them.

I've put up an example of what I mean, here:

1) JFreechart. Notice cotinnuous yellow line at bottom:
Image

2) Gnuplot: Notice noncontiguous brown line and points at bottom:
Image

Any ideas?

Thanks!
Gary

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Noncontiguous LineAndShapeRenderer

Post by david.gilbert » Fri Nov 08, 2013 9:11 am

Put an entry with a value of null in the data series and this item will break the line.
David Gilbert
JFreeChart Project Leader

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

chunkyks
Posts: 8
Joined: Sat Sep 24, 2011 2:56 am
antibot: No, of course not.

Re: Noncontiguous LineAndShapeRenderer

Post by chunkyks » Fri Nov 08, 2013 8:59 pm

That worked perfectly. Thank-you!

Gary

Locked