-
-
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
Selectable marker view & images at Y axis #485
Comments
|
Thanks for your help!
|
Let me save your day :) You need to calculate the tap point I think. Using UIView will cost you a lot (think about zooming/scrolling) to write a similar one. If you don't allow to tap the marker while animating, it seems not that hard to write. Some downside is that if you have many chart markers, determining which one is the closest to the tap point is O(n) cost. |
Thanks @liuxuan30. Feels like the best way to handle this. I have tried to extend the BarLineChartViewBase and add a new target to the already existing tap gesture recognizer. Did you take the same approach? |
Just put your delegate at the last line of |
Okay! I see what you mean. When you said extend, I thought you where talking about a Swift-extension. I would preferably try to find a solution that doesn't require me to modify the actual framework, but rather introspect or subclass the framework classes. That will make it easier to maintain and update the framework to newer versions later on. |
Yes, that solution did work in the way I expected. Now it seems like I can achieve what I want without modifying any classes in the framework. Thanks for your help @liuxuan30 |
Hey I do mean swift extension by saying 'extending'. Just like category to ObjC. |
Hi!
I would like to have my marker view tappable, but as far as I can tell, I can't really provide an actual UIView to be presented inside the marker view. The marker view class is only responsible for directly drawing on the provided CGContext. Is there a neat way to approach this, or is it the best option to add a gesture recognizer to the chart and check if the tap point is at the marker?
Also, I am looking to change the labels on the X axis of my bar chart into images. I'm really not sure how to approach this either. I'm thinking that maybe I should create a custom ChartAxisRenderer..? Or layout the images as subviews on a containing view, and then try to reposition them accordingly as the chart is panned, resized or translated in any way?
Thanks in advance.
The text was updated successfully, but these errors were encountered: