handleLegendItemTapped method
void
handleLegendItemTapped(
- LegendItem item,
- bool isToggled
)
override
Implementation
@override
void handleLegendItemTapped(LegendItem item, bool isToggled) {
if (parent != null && parent!.onLegendTapped != null) {
final ChartLegendItem legendItem = item as ChartLegendItem;
final LegendTapArgs args = LegendTapArgs(
legendItem.series, legendItem.seriesIndex, legendItem.pointIndex);
parent!.onLegendTapped!(args);
}
parent!.behaviorArea?.hideInteractiveTooltip();
controller.isVisible = !isToggled;
if (controller.isVisible == !isToggled) {
item.onToggled?.call();
visibilityBeforeTogglingLegend = isToggled;
animateAllBarSeries(parent!);
}
if (trendlineContainer != null) {
trendlineContainer!.updateLegendState(item, isToggled);
markNeedsLegendUpdate();
}
markNeedsUpdate();
}