Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LineChartRenderer - drawHighlighted:context:indices: #3267

Closed
klenovdima opened this issue Feb 13, 2018 · 4 comments
Closed

LineChartRenderer - drawHighlighted:context:indices: #3267

klenovdima opened this issue Feb 13, 2018 · 4 comments

Comments

@klenovdima
Copy link

Hi,
Thank you for porting the lib.

There is an error in LineChartRenderer class drawHighlighted:context:indices:

I got the error:

this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem.

because of following lines of code:

let x = high.x // get the x-position
let y = high.y * Double(animator.phaseY)

Seems the lines should be following:

let x = e.x // get the x-position
let y = e.y * Double(animator.phaseY)

Please fix.

Thank you.

@liuxuan30
Copy link
Member

liuxuan30 commented Feb 17, 2018

you have to first figure out why your high contains NaN.
Please help debug how highlight object is generated, to see if it's your fault or ours; if latter, we will fix it.
feel free to reply with more details and reopen this issue.

@klenovdima
Copy link
Author

I think the height contains NaN because I use
lineChartView.highlightValue(x: someIntValue, dataSetIndex: 0, callDelegate: false)
If I use tap to highlight value I don't have such problem.

Please let me know if you need more details.

@klenovdima
Copy link
Author

Can't reopen issue.

@liuxuan30
Copy link
Member

liuxuan30 commented Feb 18, 2018

@klenovdima lineChartView.highlightValue(x: someIntValue, dataSetIndex: 0, callDelegate: false) calling this won't trigger NaN crash, unless your x is NaN, or leads to NaN, which is not allowed in the first place.

You have to debug where it generates NaN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants