To access the data use the Database Connector: https://marketplace.mendix.com/link/component/2888
The next step is to prepare the data for usage in the Pie Chart. Depending on the presentation options (see next), you either populate the data retrieved using the Database Connector in, for example, a non-persistent Entity that is the source for the Pie Chart, or when using Any Chart, you need to transform the data into a JSON using an Export Mapping.
It took me a whole day to figure out how the Any Chart had to work for me as specified in the User Story. I used https://www.youtube.com/watch?v=SMzYrc9h6ZQ to get the basic setup right.
Go Make It