shift chart left

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
PollerJava
Posts: 81
Joined: Wed Jul 25, 2007 10:40 am

shift chart left

Post by PollerJava » Mon Jan 19, 2009 10:57 am

Morning,

I have 2 button (one to shift the chart left, and one right),
for example if I shift left and the line(s) end than I will open a popup-frame to ask whether data should be reloaded.

My question now is, how is the easiest way to recognize the end of the line (data), is there a listener or must I iterate through the data of the series?

Thank a lot for your help,
All the best,
Poller

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

Post by david.gilbert » Tue Jan 20, 2009 10:10 am

You need to look directly in the dataset. If you know your series are ordered (for example, increasing by x-value) then you only need to look at the last item in each series. If not, then iterating over all items in the dataset is the default way to find the bounds...unless you implement a dataset class that caches the upper and lower bounds and provides that information via the DomainInfo and/or RangeInfo interfaces (or your own methods).
David Gilbert
JFreeChart Project Leader

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

Locked