Calculate data for pie chart correct