addLegendLabelClickListener for Pie Chart never getting called.

Using the addLegendHideListener and addLegendShowListener works, but they call functions that I don’t want called, so I’m using simple click listeners on my pie chart legend instead. addLegendMarkerClickListener works great, but addLegendLabelClickListener never even gets called when I click on a legend label. I need to either get that working, or disable the labels from effecting the chart. Either one of these solutions would work great.

Can you help me out?
Thanks

This is the block of code that never get’s called


    chartPie.addLegendLabelClickListener(event -> {
        PieChartValues selectedSlice = (PieChartValues) event.getItem();
        ...
    });

Hi,
it is not clear from AmCharts documentation: https://docs.amcharts.com/3/javascriptcharts/AmLegend, but you have to set textClickEnabled of a legend to true to be able to handle clicks on legend labels:


<chart:pieChart id="pieChart" width="100%" height="100%">
    <chart:legend textClickEnabled="true"/>
</chart:pieChart>

Also take a look at switchable property of a legend, it may be useful.

Thanks!