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

Distance between chart legend and the chart is to big in case of rotated labels #1360

Closed
SvenMuc opened this issue Aug 25, 2016 · 12 comments
Closed

Comments

@SvenMuc
Copy link
Contributor

SvenMuc commented Aug 25, 2016

Hi,

I have a horizontal bar chart as shown in the picture. As soon as I rotate the x-axis labels the distance between the legend and the chart increases. Any ideas how to reduce the gap?

chart.xAxis.labelRotationAngle = -90.0

chart_legend

@danielgindi
Copy link
Collaborator

What version of Charts is this?

@danielgindi
Copy link
Collaborator

@PhilJay is it possible that offsets/calculations of xAxis affect the yAxis in horizontal charts?

@PhilJay
Copy link
Collaborator

PhilJay commented Aug 30, 2016

Hey man, sorry for the late reply, I was on vacation (once again). Yes, that could be the case, this should be investigated!

@SvenMuc
Copy link
Contributor Author

SvenMuc commented Aug 30, 2016

What version of Charts is this?

I'm using version 2.2.5

@liuxuan30 liuxuan30 added the bug label Aug 31, 2016
@kientux
Copy link

kientux commented Sep 6, 2016

+1

This happens with line chart too.

@danielgindi
Copy link
Collaborator

I can't reproduce this on Charts 3.0. Seems solved to me :-)

@srswanson
Copy link

I am experiencing the same issue with line charts in Charts 3.0.1.

windChartView.legend.orientation = .horizontal
windChartView.legend.verticalAlignment = .top
windChartView.legend.horizontalAlignment = .center
windChartView.legend.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.footnote)

windChartView.xAxis.labelRotationAngle = 90 (also happens with -45 and 45)

@mariovillamizar
Copy link

Yes, same issue for me using Charts 3.0.2

@SvenMuc
Copy link
Contributor Author

SvenMuc commented Oct 9, 2017

This bug is not yet solved. I can reproduce it with the latest Charts 3.x versions. If I merge the fix from my pull request #2214 everything works as expected. See also open issue #2138.

@danielgindi @PhilJay @liuxuan30
When are planning to merge the fix/pull request #2214 into to official version?

@thierryH91200
Copy link
Contributor

see also #2414

@liuxuan30
Copy link
Member

liuxuan30 commented Oct 17, 2017

sorry. It has been busy all the time.
I need some recalls. I remember it's not just for horizontal bar chart right? such as #2414 as above?

Are #2414 and #2138 the same issue? If so, can we merge this two PRs together?

If they are different issues and #2214 is just a quick fix for horizontal bar chart, I think I could help merge recently. But we need to figure out the scope first.

@SvenMuc
Copy link
Contributor Author

SvenMuc commented Oct 17, 2017

@liuxuan30 they look somehow related. But I'm not sure if the same fix solves both issues.

#2414 deals with offset issue with 90° rotated labels in a line chart
#2138 deals with offset issue with 90° rotated labels in a horizontal bar charts

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

No branches or pull requests

8 participants