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

Highlight midPoint of visible area #4032

Closed
izik461 opened this issue Jun 19, 2019 · 1 comment
Closed

Highlight midPoint of visible area #4032

izik461 opened this issue Jun 19, 2019 · 1 comment

Comments

@izik461
Copy link

izik461 commented Jun 19, 2019

https://stackoverflow.com/questions/56666001/swift-charts-highlight-center-point
I am trying to get the data point (highlight) closest to the middle of visible area of the graph.
I am, however, receiving the closest to the lower-left corner of visible area.
Details on stackoverflow.

Thanks in advance for any help.

EDIT:
I've figured out, that the valueForTouchPoint was performing a wrong transformation.
Disabling the .applying(pixelToValueMatrix) helped (I know I shouldn't comment it).

  @objc open func valueForTouchPoint(x: CGFloat, y: CGFloat) -> CGPoint
    {
        return CGPoint(x: x, y: y)//CGPoint(x: x, y: y).applying(pixelToValueMatrix)
    }
@izik461 izik461 closed this as completed Jun 24, 2019
@izik461
Copy link
Author

izik461 commented Jun 24, 2019

Fixed - I've been using the chart coordinates and not the UIViews coordinates.

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

No branches or pull requests

1 participant