Wrapping XYPlot Around Graph

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
kathryn
Posts: 2
Joined: Wed Nov 19, 2014 3:49 pm
antibot: No, of course not.

Wrapping XYPlot Around Graph

Post by kathryn » Wed Nov 19, 2014 3:55 pm

Hello,
I am trying to graph orientation on an XY plot. I would like the plot to go off the page and return above or below. Example: Take a compass where North is 0*. Something is heading 5*, then turns to the left and goes at 355*. The object only turned 10 degrees, and I would like to demonstrate this without the line jumping all over the graph. In an ideal world, the line would travel downwards until it reaches 0, then reappear at 360 and travel down to 355. I have tried a few things and not been successful at them.

ModuloAxis just keeps repeating the numbers 0-360 above and below. This could work if I could force it to stay within 0-360, but so far I have been unsuccessful.
NumberFormat just affects the axis and not the data.
Creating a separate series keeps adding that to the graph in a different color and adding another item to the legend.
Lastly, I have tried just hardcoding it to 0 and then to 360 and attempting to erase the middle section, but that has also been unsuccessful.

If you have any new ideas, or any ideas how to fix my problems I've had so far, please let me know. I think the best soultion would be with either NumberFormat or ModuloAxis because I don't want to have to hardcode in where to erase the line or making a new series.

Thanks for any advice you guys may have.

mkivinie
Posts: 51
Joined: Wed Jul 06, 2005 8:35 am

Re: Wrapping XYPlot Around Graph

Post by mkivinie » Fri Nov 28, 2014 1:07 pm

I don't fully understand what your X-axis is (some kind of time, perhaps?), but here is a suggestion:

use just the one series:
-add value (x1, 5)
-add value (x2, 0)
-add value(x2, null)
-add value(x2, 360)
-add value(x3, 355)

So you would compute the change from 0 to 360 before adding the data to the series.
Adding the null -value causes discontinuity (empty segment) in the line.

kathryn
Posts: 2
Joined: Wed Nov 19, 2014 3:49 pm
antibot: No, of course not.

Re: Wrapping XYPlot Around Graph

Post by kathryn » Mon Dec 01, 2014 1:51 pm

That is perfect, thank you! And yes, the x-axis is time.

Locked