I am working with chartjs and have encountered a scenario where I need to disable actions when a legend item is clicked, but only under certain conditions. I was able to accomplish this using the following code snippet:
legend: {
position: 'right',
onClick: (e) => {
if (!this.isFilterView)
e.stopPropagation();
},
However, when the filter view is active, I want the legend items to function as usual when clicked. The current code does not provide this functionality. Is there a way to achieve this?