handleLegendItemTapped method
void
handleLegendItemTapped(
- LegendItem item,
- bool isToggled
)
override
Implementation
@override
void handleLegendItemTapped(LegendItem item, bool isToggled) {
super.handleLegendItemTapped(item, isToggled);
final ChartLegendItem legendItem = item as ChartLegendItem;
if (legendItem.pointIndex < segments.length) {
segmentAt(legendItem.pointIndex).isVisible = !isToggled;
}
legendItem.onToggled?.call();
animationType = AnimationType.realtime;
canUpdateOrCreateSegments = true;
markNeedsLayout();
}