new method to get value counts for histogram/pie charts