-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Avoid passing NaN to CoreGraphics API (Fixes #1626) #2568
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2568 +/- ##
=========================================
Coverage ? 19.65%
=========================================
Files ? 112
Lines ? 13717
Branches ? 0
=========================================
Hits ? 2696
Misses ? 11021
Partials ? 0
Continue to review full report at Codecov.
|
Thank you for the description! I'd like to have this reviewed this this week. I'm unclear as to why we should be using the y value from |
I think we should first figure out why there is NaN during the process, rather than bypass it. Any NaN directly reflects something wrong with the data, or the interval(min/max value) we calculated based on the data, otherwise it should be safe. NaN generated by user's invalid data should not be our responsibilities, they should be warned. The interval/min/max value we have are ours, like the one we merged: #2377 BTW, will #2377 fix your issues? @chiahan1123 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rejecting for the moment.
We should know what's causing NaN
Hi there, sorry it took so long to realize this is a good catch! Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approve
Fix issue #1626
The
Highlight
object generated in theChartViewBase
class contains aDouble.NaN
y-value when calling thehighlightValue
functions that does not require a y-value.In the
LineChartRenderer
class, thedrawHighlighted
function passes the NaN y-value into theTransformer
pixelForValues
to apply thevalueToPixelMatrix
, which will result in the x-value being a NaN; therefore, causing theLineScatterCandleRadarRenderer
drawHighlightLines
to move to a CGPoint with a NaN x-value.To fix this, the y-value being passed into
pixelForValues
should be from theentryForXValue
.