How can I make gaps in line chart?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Martin Omasreiter

How can I make gaps in line chart?

Post by Martin Omasreiter » Sun Nov 10, 2002 8:48 pm

Hi there!

I've got the following problem:
For the graphical output of stock values I have a domain axis which gives the date and a range axis which gives the values. My program reads the values from a database. However, when there are no values given for a certain period of time, JFreeChart draws a straight line from the last given value to the next given value.

What I want instead is no line at all where there are no values given, that is, a gap in the chart. Any idea how to achieve that problem?

Thanks in advance.
Martin

Dave Gilbert

Re: How can I make gaps in line chart?

Post by Dave Gilbert » Mon Nov 11, 2002 10:27 am

The reason for this is that JFreeChart makes no assumptions about how regular your data values are, it simply connects all of them by lines. But if you add an item with a valid x-value, and null for the y-value, JFreeChart interprets this as missing or unknown data, and will disconnect the line.

Regards,

DG

Locked