I am implementing a feature to load more historical data when users pan to the left side on a CategoryDateAxis.
To load more, i need to have 2 Date which is the earliest data point i have and the Date that is shown on the X-Axis
For the earliest data point, i can get via IXyDataSeries#getXMin()
But for the other Date, i’m not sure how to get it. I can listen to range changes via IAxisCore#VisibleRangeChangeListener, but the range returns Double. I cant figure out to convert it into a Date
- abc def asked 8 years ago
- You must login to post comments
Hi there,
We have an API to convert between Index and Date on the CategoryDateTimeAxis.
So the Axis itself has visiblerange which is an IndexRange. Take the min of this to get the min index.
Next, use code similar to this documentation article to do the conversion.
IAxis xAxis = new CategoryDateAxis(getActivity());
// get ICategoryLabelProvider to convert Date values to Indexes and vice versa
ICategoryLabelProvider categoryLabelProvider = (ICategoryLabelProvider)xAxis.getLabelProvider();
java.util.Date startDate = categoryLabelProvider.transformIndexToData(xAxis.getVisibleRange().getMin());
Let me know if that helps!
Best regards,
Andrew
- Andrew Burnett-Thompson answered 8 years ago
-
Hi Andrew, How can I prepend history date to dataseries? every time I add data to data series it tell me “Data has been changed to a DataSeries which is unsorted in the X-Direction. Unsorted data can have severe performance implications in SciChart.”
-
Hi Tang, if you use dataSeries.Insert you can pre-pend data to a dataseries. It is also possible to Append data unsorted. Simply set the dataSeries.setAcceptsUnsortedData(true). However, this comes with a performance warning.
- You must login to post comments
Please login first to submit.