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

Legend vertical offset for horizontally aligned legends #2223

Closed
slxl opened this issue Mar 4, 2017 · 3 comments
Closed

Legend vertical offset for horizontally aligned legends #2223

slxl opened this issue Mar 4, 2017 · 3 comments

Comments

@slxl
Copy link

slxl commented Mar 4, 2017

Trying to offset the legend from chart view using:

chartLegend.yOffset = 36

and instead of margin between chart and legend I got an emptiness below legend with desired value [of 36] while legend keeps sticking to chart view with no margin at all

2017-03-05 00 04 48

is it a bug or am I doing it wrong?
Thanks!

@liuxuan30
Copy link
Member

I can barely understand...
you set 36 y offset, and it did the job.

@slxl
Copy link
Author

slxl commented Mar 7, 2017

@liuxuan30 actually I expected a gap between chart and legend, bcs curent (external margin) could be achieved by using of just a different frame for chart

@liuxuan30
Copy link
Member

oh, please take a look at open func renderLegend(context: CGContext) for how the position is calculated. It has been a while and I don't remember how it calculates.

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

2 participants