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

Highlighting buggy / not working consistently #4609

Closed
1 task done
gavynriebau opened this issue Mar 24, 2021 · 2 comments
Closed
1 task done

Highlighting buggy / not working consistently #4609

gavynriebau opened this issue Mar 24, 2021 · 2 comments

Comments

@gavynriebau
Copy link

gavynriebau commented Mar 24, 2021

What did you do?

Added a line chart control to show time series chart data and enabled highlighting so that when the chart is tapped the tapped value is highlighted.

What did you expect to happen?

The entry closest to the tap point should be highlighted

What happened instead?

  • The majority of the time no entry is highlighted even after tapping all around the chart
  • Rarely an entry actually is highlighted but given hightlighting fails the majority of the time the overall behavior is very poor

Charts Environment

Charts version/Branch/Commit Number: 4.0.1/master/e91ba716190836b013ef8a9ca53e220ad5051e21
Xcode version: 12.4
Swift version: 5
Platform(s) running Charts: simulator iPad Air (4th Generation) 14.4
macOS version running Xcode: 10.15.6

Demo Project

https://github.com/gavynriebau/DemoChartsBug


Details about the demo project

The Chart

Figure 1: The chart that is rendered when this project is run

Figure 2 shows a stack trace which highlights the problem area.

This stack trace was generated by tapping a point just after the 5th chart entry.

In the debug window it can be seen that the variable i is set to 11 indicating the partitionIndex func did not correctly find the index of the first item that matches the predicate on line 199.

Given the argument xValue having value 6 the expected return for i should be 6.

The values contained within the ChartDataSet, along with their indexes, are printed in the bottom right of figure 2.

The overall result is that the entriesForXValue func returns an empty array and the chart highlighting / selection fails for that tap.

Stack

Figure 2: Call stack showing where filtering goes wrong

@gavynriebau
Copy link
Author

I think my issue may be the same or similar to #4579

@pmairoldi
Copy link
Collaborator

Closed by #4721

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