implement the dynamically updating pie chart