js fix for pie chart plotting