SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!
Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.
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
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!
Please login first to submit.