Generalize charts to show chart by category