Fix bug in XBounds
calculation of minimum/maximum visible entry index.
#1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Base Repo PR: ChartsOrg#4839
XBounds
looks for data entries on the boundary of or outside of the visible range. However, there may not be any such entries for a particular data set.Imagine a chart with two data sets, one of which has a bigger range of x-values than the other. The chart’s zoomed-out visible range would be the range of the wider data set. When the renderer tries to render the narrower data set, it would fail to correctly calculate the starting and ending entry indices because the starting/ending entries are strictly inside of the visible range.
The fix is to add fallback logic to look for data entries inside of the visible range if the initial algorithm does not find anything.
The
XBounds
bug fix also requires a bug fix inChartDataSet
’s binary search algorithm.Issue Link 🔗
Goals ⚽
Implementation Details 🚧
Testing Details 🔍