Use a function to view group statistics with a pie chart