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

Marker frame adjustment according to bounds #364

Closed
kaustubhkabra opened this issue Sep 15, 2015 · 13 comments
Closed

Marker frame adjustment according to bounds #364

kaustubhkabra opened this issue Sep 15, 2015 · 13 comments

Comments

@kaustubhkabra
Copy link

I am showing values on a standard graph, which has minimum origin defined. The Chartview is added as a subview on UISplitViewController. As a result, the marker view which appears on click of a point close to X axis is getting cut. Screenshot-
screen shot 2015-09-14 at 10 57 11 pm
Any suggestion to fix this behaviour ?

@liuxuan30
Copy link
Member

have you tried find out which view is responsible for clipping, the chart view, or your super view?

@kaustubhkabra
Copy link
Author

I want the marker view to be on top of any underlying subviews. Still better, if it can sense the bounds of chart view and align content/arrow location such that no clipping happens - similar to way iOS presents UIPopupViewController.

Thanks for the quick reply !

@liuxuan30
Copy link
Member

I checked that drawMarkers(context: context!) will not be clipped, it's not another view. Do you set any maskToBounds in your super views?

@kaustubhkabra
Copy link
Author

Nothing explicitly set for maskToBounds to any views in this controller.

@liuxuan30
Copy link
Member

Well I guess you need to debug then. Just walk through you super views and see who's frame your marker view got clipped out of the frame.

@liuxuan30
Copy link
Member

BTW, you need to check how you draw the text as well.

@kaustubhkabra
Copy link
Author

ok thanks, will check and update this thread later.

@kaustubhkabra
Copy link
Author

As per your suggestion, I tried setting masksToBounds and clipsToBounds to NO for all superviews in hierarchy of chart view.

UIView *thisView = self.chartView; //this is reference to my line chart view
do{
thisView.clipsToBounds = NO;
thisView.layer.masksToBounds = NO;
thisView = v.superview;
} while(thisView != nil);

Issue still persists. Any insights ?

@liuxuan30
Copy link
Member

If no view clips your marker, have you checked how you draw the text. I looked at your screenshot, the text is first not left aligned? You may check here too. You could try use another background color to exclude what's the root cause. If your marker view is not clipped at all, then it's text drawing issue, like font size, multiple lines, alignment, etc.

@liuxuan30
Copy link
Member

@kaustubh-kabra any updates?

@liuxuan30
Copy link
Member

Closing - I guess you solved the problem? Welcome to post answer here

@gsolanki1509
Copy link

@KK-CODE how do you set values to Marker View before showing them on click of chart?

@MarinaHuber
Copy link

@KK-CODE how do you set values to Marker View before showing them on click of chart?

I have the similar question. How do you show maker and highlights bar on a first lunch instead of touch?

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

4 participants