@ashar1990
Here's how you can set up a pie chart in your Power Apps Canvas App to display the RAG (Red-Amber-Green) analysis for a selected employee.
You first should add a ComboBox for the employee names and a PieChart control:
1. Add a ComboBox control to your screen.
You should set the Items property of the ComboBox to your SharePoint list to load all employee names.
This formula should be something like:
ComboBox1.Items = Distinct('YourSharePointList', 'EmployeeNameColumn')
Make sure to replace 'YourSharePointList' and 'EmployeeNameColumn' with your actual SharePoint list name and employee name column respectively.
2. Add a PieChart control to your screen.
You should set the Items property of your PieChart1 to filter the SharePoint list based on the selected employee in the ComboBox. This formula should be:
Filter('YourSharePointList', 'EmployeeNameColumn' = ComboBox1.Selected.Result)
Again, replace 'YourSharePointList' and 'EmployeeNameColumn' with your actual SharePoint list name and employee name column.
3. Configure the PieChart.
The PieChart control needs to know which fields to use for the sector values and labels. This can be achieved by setting the PieChart1 Series property to point to your 'RAG' column like this:
{Value: 'RAGColumn', SeriesColor: 'ColorColumn'}
Replace 'RAGColumn' and 'ColorColumn' with your actual RAG column and color column in the SharePoint list. If you don't have a color column, you can set colors directly in the formula like this for the Series property of your PieChart1:
{
Value: 'RAGColumn',
SeriesColor: Switch('RAGColumn',
"Red", RGBA(255, 0, 0, 1),
"Amber", RGBA(255, 191, 0, 1),
"Green", RGBA(0, 255, 0, 1)
)
}
In this formula, the Switch function maps each 'RAG' value to a corresponding color.
With these settings, when you select an employee name in the ComboBox, the PieChart should update to show the RAG analysis for the selected employee. Please replace placeholder values in the formulas above with your actual column names and data.
See if it helps @ashar1990