Is it possible to have a chart only show the end of a series

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
farrellf
Posts: 1
Joined: Mon May 18, 2015 10:12 pm
antibot: No, of course not.

Is it possible to have a chart only show the end of a series

Post by farrellf » Mon May 18, 2015 10:23 pm

Hello,

I'm using an XYLineChart and I send it live data. Is it possible to have the chart only show the latest N values from an XYSeries / XYSeriesCollection? The series is populated in order (x always increasing) if that makes a difference. If possible, I would prefer to leave the "old" data in the XYSeries, as I may want to chart the entire series later on.

-Farrell

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

Re: Is it possible to have a chart only show the end of a se

Post by mkivinie » Wed May 20, 2015 10:51 am

A couple of possiblities:

Either implement your own Dataset wrapper that returns only the N latest points even when having more than N.
Or alternatively implement zooming and/or scrolling to your graph so that the view only shows the N latest but you can scroll back to view the older data.

Locked