Can 'showingTooltipIndicators' and 'lineTouchData' be used at the same time in fl_chart
Provide more details
Hi I think I have the same question.
If I set enabled = false on LineTouchData then the "permanent" tooltips appear from the showingTooltipIndicators field. However, if I set enabled = true on LineTouchData then the permanent tooltips will not show up.
My use case calls for both. I want to "always" show a tooltip for min and max values on my graph but when a user taps/drags on the graph I want to hide those tooltips and show LineTouchData UI. Hopefully that makes sense. Thanks!
Follow up, you can get this behavior like so:
LineTouchData get lineTouchData => LineTouchData(
touchCallback: (touchEvent, response) {
if (touchEvent is FlTapUpEvent || touchEvent is FlPanEndEvent) {
if (touchingGraph) {
setState(() {
touchingGraph = false;
});
}
} else if (touchEvent is FlTapDownEvent || touchEvent is FlPanStartEvent) {
if (!touchingGraph) {
setState(() {
touchingGraph = true;
});
}
}
},
handleBuiltInTouches: true,
enabled: touchingGraph,
...
Where touchingGraph is a bool you can declare somewhere in your class.
Thanks man, it worked just fine
في الأربعاء، 2 فبراير 2022 في 11:40 م تمت كتابة ما يلي بواسطة Brendan < @.***>:
Follow up, you can get this behavior like so:
LineTouchData get lineTouchData => LineTouchData( touchCallback: (touchEvent, response) { if (touchEvent is FlTapUpEvent || touchEvent is FlPanEndEvent) { if (touchingGraph) { setState(() { touchingGraph = false; }); } } else if (touchEvent is FlTapDownEvent || touchEvent is FlPanStartEvent) { if (!touchingGraph) { setState(() { touchingGraph = true; }); } } }, handleBuiltInTouches: true, enabled: touchingGraph, ...
Where touchingGraph is a bool you can declare somewhere in your class.
— Reply to this email directly, view it on GitHub https://github.com/imaNNeoFighT/fl_chart/issues/831#issuecomment-1028383341, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOYERELI6EADK7DBJCEUMSTUZGQEVANCNFSM5JAF4SVQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
The above workaround only works when I have one graph, but if I have several and when tracking one at a time, I want to highlight the corresponding points on the rest, @SpaceWaffles solution is not suitable. Perhaps someone found where this restriction is specifically imposed and for what reason ?