fl_chart
fl_chart copied to clipboard
Display tooltip when pressing a point in a line containing multiple points that all have the same x value.
** Don't make a duplicate issue. It does not appear to a similar issue for this (if there is, i apologise).
Thank you for a great package! After many tries there does not seem to be a way to display a tooltip when pressing a singular point in a line that has multiple points that all have the same x value in a graph.


Am i missing something. The touchCallback function always returns the lowest point on the line when clicking other points.
Hi. What do you prefer? Showing tooltip on the point, you touch? Or the highest one?
It seems like you want to show the tooltip for the dot you press? By default only the x distance between the touch to the dot is used to find the closest one. Using LineTouchData.distanceCalculator
you can write your own function that uses the Euclidean distance. This would then select the dot you press.
Hi. What do you prefer? Showing tooltip on the point, you touch? Or the highest one?
Showing the tooltip on the point (or right above the point)
It seems like you want to show the tooltip for the dot you press? By default only the x distance between the touch to the dot is used to find the closest one. Using
LineTouchData.distanceCalculator
you can write your own function that uses the Euclidean distance. This would then select the dot you press.
Cool i will try it out!
how did it work out? currently trying out a similar thing
Can you please add some sample code how to use LineTouchData.distanceCalculator
to show the tooltip for the dot you press? @joeldomke @imaNNeo