How can I avoid the popup data to show when I touch the LineChart ? I tried putting the object touchTooltipData: in LineTouchData at null but then my state is not updated correctly to my other widgets.
Another related question: how can I let the chart listen to normalPress and not only longPress? Each time I try to interact with the chart I have to "longpress" it
Solved with
lineTouchData: LineTouchData(
touchResponseSink: controller.sink,
touchTooltipData: TouchTooltipData(
tooltipBgColor: Colors.blueGrey,
getTooltipItems: (touchedSpots) {
return touchedSpots.map((touchedSpot) {
return null;
}).toList();
})),
returning null at getTooltipItems did the trick 馃憤
Hi,
Well done about the trick, It is intentionally allowed to return null to prevent show the tooltip (maybe you want to disable it in first and last spot, you can retuen them null),
And about the normal touch, you're right currently we support only long touch, I will add normal touch to the chart ASAP
Keep rocking! Hope to send my first PR soon :D
Another related question: how can I let the chart listen to normalPress and not only longPress? Each time I try to interact with the chart I have to "longpress" it
@davidmarinangeli did you find solution for this?
Guys, currently you can't implement normal touch events in the chart,
If it is important to you, please make an issue, then thumb it up, I will add it with high priority.
Hi,
Another related question: how can I let the chart listen to normalPress and not only longPress? Each time I try to interact with the chart I have to "longpress" it
@davidmarinangeli did you find solution for this?
As Iman told us the normal touch is a feature that will come eventually later. If you want to make an issue I will be really happy to thumb it up.
Most helpful comment
Hi,
Well done about the trick, It is intentionally allowed to return null to prevent show the tooltip (maybe you want to disable it in first and last spot, you can retuen them null),
And about the normal touch, you're right currently we support only long touch, I will add normal touch to the chart ASAP