(data: any, _: any, event: React.MouseEvent)
| 704 | const stacked = barSeries.type === "stacked"; |
| 705 | |
| 706 | function onBarClick(data: any, _: any, event: React.MouseEvent) { |
| 707 | event.stopPropagation(); |
| 708 | if (!onValueChange) return; |
| 709 | if (deepEqual(activeBar, { ...data.payload, value: data.value })) { |
| 710 | setActiveLegend(undefined); |
| 711 | setActiveBar(undefined); |
| 712 | onValueChange?.(null); |
| 713 | } else { |
| 714 | setActiveLegend(data.tooltipPayload?.[0]?.dataKey); |
| 715 | setActiveBar({ |
| 716 | ...data.payload, |
| 717 | value: data.value, |
| 718 | }); |
| 719 | onValueChange?.({ |
| 720 | eventType: "bar", |
| 721 | categoryClicked: data.tooltipPayload?.[0]?.dataKey, |
| 722 | ...data.payload, |
| 723 | }); |
| 724 | } |
| 725 | } |
| 726 | |
| 727 | function onDotClick(itemData: any, event: React.MouseEvent) { |
| 728 | event.stopPropagation(); |
nothing calls this directly
no test coverage detected