fl_chart icon indicating copy to clipboard operation
fl_chart copied to clipboard

Add custom extra dynamic data for FlSpot

Open kylechandev opened this issue 10 months ago • 1 comments

Add custom extra dynamic data for FlSpot, then we can easily display the custom information of each data point in LineTouchTooltipData.

For example: FlSpot(double x, double y, dynamic data);

touchTooltipData: LineTouchTooltipData( fitInsideHorizontally: true, fitInsideVertically: true, getTooltipItems: (List<LineBarSpot> touchedBarSpots) { return touchedBarSpots.map((touchedSpot) { dynamic data = touchedSpot.data; } } );

kylechandev avatar Feb 10 '25 13:02 kylechandev

Maybe you can get your specific item with touchedSpot.barIndex and touchedSpot.spotIndex.

mluttmann avatar Feb 18 '25 17:02 mluttmann