LineChart Dataset not rendering
- Dominant language
- Swift
- Stars
- 28k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
* [x] I've read, understood, and done my best to follow the [*CONTRIBUTING guidelines](https://github.com/jjatie/Charts/blob/master/CONTRIBUTING.md).
## What did you do?
Attempting to draw to line chart datasets.
## What did you expect to happen?
Both datasets should be rendered.
## What happened instead?
Only one dataset was rendered.
## Charts Environment
**Charts version/Branch/Commit Number:** master branch
**Xcode version:** 13.0 beta 3
**Swift version:** 5.x
**Platform(s) running Charts:** macOS
**macOS version running Xcode:** 12.0 beta 3
## Reason
Tracked the issue down to the following method.
open override func entryIndex(
x xValue: Double,
closestToY yValue: Double,
rounding: ChartDataSetRounding) -> Int
in
ChartDataSet
is returning -1 instead of the last index when xValue is equal to or larger than the x-axis entries. This led to an empty range being drawn for one of the two datasets.
Contributor guide
Assessment
This issue has not been assessed yet.