Fl_chart: How to turn off TouchTooltipData when touching a chart

Created on 7 Jul 2019  路  6Comments  路  Source: imaNNeoFighT/fl_chart

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

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

All 6 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jitenders859 picture jitenders859  路  5Comments

enyo picture enyo  路  4Comments

Saran90 picture Saran90  路  5Comments

kw2019ltd picture kw2019ltd  路  6Comments

mukhammad-akilov picture mukhammad-akilov  路  4Comments