Hi I have created the following line chart:
Chart un-zoomed
Image
Chart zoomed
Image
I created the chart with XYSeriesCollection then added to it three XYSeries. The chart works great and I can zoom in and pan left and right.
My problem is that I'm trying to save the data currently displayed in the chart view for each of the datasets (in this case 3). The chart data is big so when a user is able to zoom in on a section I want them to be able to save the data shown in that section. I would appreciate help with this?
Returning the data displayed in the line chart current view
-
- Posts: 513
- Joined: Wed Sep 12, 2007 3:18 pm
Re: Returning the data displayed in the line chart current view
Examine the chart's XYPlot to learn the current range of the desired axis:
Use the range values to iterate over the dataset. DatasetUtils illustrates typical iteration schemes.
Code: Select all
Range domain = chart.getXYPlot().getDomainAxis().getRange();
Range range = chart.getXYPlot().getRangeAxis().getRange();