Yes, this is possible. You can use the ChartJS Widget from App Store and use a non persistent entity associated with the entity you would like the user to select from the reference selector. Assuming that the user is selecting a country from the reference selector, the domain model would look like this:
Now on the form level it would look like the below, were the reference selector is placed inside the Data View which has a data source of the Chart entity. And on change of the reference selector you can call a microflow to refresh the Chart object which in return will call again the DS microflow that you are going to specify inside the Chart Widget which is supposed to fetch and display the data in the chart based on the value selected by the user.
The Chart widget also has its documentation that will guide on how to display the data etc.
You can find this on https://appstore.home.mendix.com/link/app/1712/
Hope my answer was of help to you and good luck! :)