Charts
Charts copied to clipboard
Fix bug in `XBounds` calculation of minimum/maximum visible entry index.
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 in ChartDataSet
’s binary search algorithm.
This conflicts with #4829 where I fixed the partitioningIndex algorithm change
My PR might fix your whole problem as you can see in the screenshot below! Could you test my fork and confirm?
@FelixHerrmann Cool! Confirmed that #4829 also partially fixes the XBounds
calculation. However, I commented on part of the change, which I believe is incorrect.
Please merge this commit soon. thanks.
Hey all, any updates on merging this in? Love the library, awesome work on it!
@lundjrl should be fixed with #4829