implement adaptive pie chart