Improved pie chart click handler