lowestVisibleX and highestVisibleX Accuracy problem
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 28k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
The accuracy problem will cause the maximum and minimum values in the screen to change, causing the Chart to shake up and down.
Cause of the problem
In my project lowestVisibleX sometimes returns 386.5 and sometimes returns 386.49999999999999.
When calling the following method
When the value of lowestVisibleX is 386.5 and the value of indexFrom is 387, when the value of lowestVisibleX is 386.49999999999999, indexFrom only returns 386. As a result, the maximum value of the Y value in the screen has been changing. which in turn causes the screen graph to jump。Is there any good solution?
##Charts Environment
Charts 4.1.0
14.3.1:
5.7:
iOS running Charts:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported difference between lowestVisibleX values of 386.5 and 386.49999999999999, then trace how indexFrom uses that value. Verify the behavior on the reported Charts 4.1.0 and iOS environment. Done means the visible range and resulting Y-axis bounds remain stable for equivalent values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100