Legend Click callback not showing which legend item was clicked and was it enabled or disabled

Hi,
When we click on legend in horizontal bar chart then, bars corresponding to that legend gets hidden but the other bars expand themselves to fill up this new created space in the chart. I want to prevent the bars from expanding when we disable a legend item.
For this I was trying to pass new height (smaller height) to chart when a legend item is disabled.

But in legend Click event I am not getting which legend item was clicked and was it enabled or disabled…Is there any way out??
My chart is a horizontal bar chart having grouped legends

I could find this link in other discussion as solution but it doesn’t work for horizontal bar chart
https://codepen.io/etpinard/pen/vVmgxe