fl_chart
fl_chart copied to clipboard
Popup/tooltip doesn't show up when x values are close
Hello @imaNNeoFighT, first of all, great job with this lib!
I've successfully implemented the line chart, but I am experiencing the issue shown in the pic below.
On the x-axis I got dates, which can be really close to each other (in this scenario the last 2 points have a delta of 15 mins) and whose corresponding y-values might be really different.
When I tap/slide on the chart, the tooltip/popup associated with the last, lower point, doesn't show up, but it does with the one right above it.
If it can be of any help:
..
bottomTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
color: Color(0xff68737d),
fontSize: 14),
getTitles: (value) {
final DateTime date =
DateTime.fromMillisecondsSinceEpoch(value.toInt());
final parts = date.toIso8601String().split("T");
return parts.first + "\n" + parts[1].split(".")[0];
},
margin: 12,
interval:
(widget.spots[widget.spots.length - 1].x - widget.spots[0].x),
),
..
Any idea about I can possibly fix this? :/
Hi, did you check fitInsideHorizontally
in LineTouchTooltipData?
Hi, did you check
fitInsideHorizontally
in LineTouchTooltipData?
it's not about a graphical problem.
The touch event on that spot (the lower one), just doesn't make the tooltip to show up. It always triggers the above tooltip. (same situation if I switch the y-values)
Can you provide ma a reproducible code (a main.dart
file)?