fl_chart
fl_chart copied to clipboard
Add custom extra dynamic data for FlSpot
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; } } );
Maybe you can get your specific item with touchedSpot.barIndex and touchedSpot.spotIndex.