Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

LongTap/doubletap effect on legends #758

Open
zheyxu opened this issue Apr 26, 2022 · 3 comments
Open

LongTap/doubletap effect on legends #758

zheyxu opened this issue Apr 26, 2022 · 3 comments

Comments

@zheyxu
Copy link

zheyxu commented Apr 26, 2022

The current charts have legends that allow items to be toggled on/off on a legend item tap/click.
Can a log tap and double click be implemented to toggle all of the other items rather than the item tapped?
So, for a legend with items A B C and D, they are all displayed by default. If I tap A then A is no longer shown.
If instead long tap A, then B C and D should be turned off.
Any hints or thoughts. Thanks!

@zheyxu zheyxu changed the title LongTap effect on legends LongTap/doubletap effect on legends Apr 27, 2022
@yuenzp
Copy link

yuenzp commented Apr 27, 2022

You can custom your own legends using Flutter widget such as Text button. It's not necessary to use charts_flutter's build in legends. A custom legends could do the same things as charts_flutter's build in legends could do and more than that. If you need the TextButton to act double tap behavior, you could wrap it with GestureDetector widget.

@zheyxu
Copy link
Author

zheyxu commented Apr 28, 2022

Thanks yuenzp! Does it mean I still use charts_flutter and I add some custom widgets. That is good solution. Is there any example code? I'd appreciate any examples.

@zheyxu
Copy link
Author

zheyxu commented May 1, 2022

Hello, #759
I created a pull request to enable long-press function.

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

No branches or pull requests

2 participants