Hi Guohoa,
Please follow the below steps
For example, I am going to show the count of students based on exam result.
Step 1 : Create a Non-Persistable entity like below
Step 2: Create a page which has a pie chart widget
Step 3: Add the below configuration details for pie chart widget
Link the microflow which calculates the values here in microflow parameter.
Step 4 DS Microflow which will calculate values
In the change object, I am mapping values for pass result like below.
In the create object, I am mapping the values for fail result like below.
The Output will be like this
I hope this will helps you.