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

Line chart keep FlLine visible #1323

Closed
zychns opened this issue Apr 26, 2023 · 1 comment
Closed

Line chart keep FlLine visible #1323

zychns opened this issue Apr 26, 2023 · 1 comment
Labels
Line Chart question Further information is requested

Comments

@zychns
Copy link

zychns commented Apr 26, 2023

Hi guys,
Can the FlLine be kept visible on the Line chart all the time after the first interaction?
Currently, the line disappears after each touch.
In addition is there a way to show x,y cords after touch through callback?

@zychns zychns closed this as completed Apr 28, 2023
@zychns
Copy link
Author

zychns commented Apr 28, 2023

found a solution by setting up showingIndicators (following line chart #5), setting handleBuiltInTouches: false, and adding the following to touchCallback:
touchCallback: (touchEvent, response) {
if (response == null || response.lineBarSpots == null) {
return;
}
if (touchEvent is FlTapDownEvent ||
touchEvent is FlPanUpdateEvent) {
final spotIndex = response.lineBarSpots!.first.spotIndex;
setState(() {
showingTooltipOnSpots.clear();
showingTooltipOnSpots.add(spotIndex);
});
}
},

@imaNNeo imaNNeo added question Further information is requested Line Chart labels Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Line Chart question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants