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

How do I implement a legend click event? #1965

Closed
monkeyRing opened this issue Dec 16, 2016 · 6 comments
Closed

How do I implement a legend click event? #1965

monkeyRing opened this issue Dec 16, 2016 · 6 comments

Comments

@monkeyRing
Copy link

hello , at all.

just as the under gif

The Preview

screenshot

Can someone help me or can you give me some ideas?

@monkeyRing
Copy link
Author

screenshot1

@liuxuan30
Copy link
Member

hmm. this is a tough task.. You need to consider using the animator and animatorJob classes. Using CoreGraphics to achieve these animations. The library does not support this yet.

@monkeyRing
Copy link
Author

@liuxuan30 the animations isn't important curently. i just want achieve onclick the legend to hide corresponding bar. have you some ideas?

@ezamagni
Copy link
Contributor

You could simply implement your custom legend in a separate view, mimicking the look and feel of Chart's one.

@monkeyRing
Copy link
Author

@ezamagni ha , I do think so, but the data source processing more difficult. thank you for your answer. :)

@liuxuan30
Copy link
Member

@monkeyRing Oh you are not asking animations.. Then it's much easier lol.
I used to write a UIScrollView for the legends, and you can do whatever you like.. Currently, the legend class is based on CoreGraphics, so you have to write a lot of things to make highlight and detect the touch event, which I don't recommend..
Just use a new view and read the data you need to create the legend and some delegates to synergy with chart library seems doable and flexible, but it is a descent amount of work.

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

3 participants