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
shift chart left
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
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
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

