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 Label problem when the device changes orientation #2224

Closed
mirceabarba opened this issue Mar 5, 2017 · 2 comments
Closed

Legend Label problem when the device changes orientation #2224

mirceabarba opened this issue Mar 5, 2017 · 2 comments

Comments

@mirceabarba
Copy link

Hi,
I am trying to remove one entry from the legend and I've used the following lines of code:
scatterChartView.data = data
scatterChartView.legend.entries.remove(at: 1)

This works the first time the Chart is rendered, but if i switch the orientation of my iPhone the legend displays all the entries.

In the pictures you can see that the first one does not show the "Cluster" DataSet, but in the second one it appears.

Can you maybe tell me what I am doing wrong?

Thank you very much

first
after

@mirceabarba
Copy link
Author

Worked around the problem by creating custom Legend.

@liuxuan30
Copy link
Member

liuxuan30 commented Mar 7, 2017

My theory is you manually removed one legend entry, however the data entry is still there. When rotating, the legend is re-calculated, so it adds back the removed legend entry.
You should be careful when doing this unless you know how it works.

On the other hand, legend shows the data label on your chart, however, I don't see the reason just to delete one legend entry: why add the specific data but not showing its own legend?

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