Show data in a line, pie, or bar chart in PowerApps
Use line charts, pie charts, and bar charts to display your data in a canvas app. When you work with charts, the data that you import should be structured based on these criteria:
- Each series should be in the first row.
- Labels should be in the leftmost column.
For example, your data should look similar to the following:
You can create and use these charts within PowerApps. Let's get started.
- Sign up for PowerApps, and then sign in using the same credentials that you used to sign up.
- Create an app from a template, from data, or from scratch.
- Learn how to configure a control in PowerApps.
- Download ChartData.zip, which contains sample data as an XML file. Follow the steps in this topic to import it directly into your app. As an alternative, decompress the .zip file, open the XML file in Excel, and save it to a cloud-storage account.
Import the sample data
In these steps, we import the sample data into a collection, named ProductRevenue.
On the Insert tab, select Controls, and then select Import:
Set the control's OnSelect property to the following function:
Press F5 to open Preview mode, and then select the Import Data button.
In the Open dialog box, select ChartData.zip, select Open, and then press Esc.
On the File menu, select Collections.
The ProductRevenue collection is listed with the chart data you imported:
The import control is used to import Excel-like data and create the collection. The import control imports data when you are creating your app, and previewing your app. Currently, the import control does not import data when you publish your app.
Press Esc to return to the default workspace.
Add a pie chart
On the Insert tab, select Charts, and then select Pie Chart.
Move the pie chart under the Import data button.
In the pie-chart control, select the middle of the pie chart:
Set the Items property of the pie chart to this expression:
The pie chart shows the revenue data from 2014.
Add a bar chart to display your data
Now, let's use this ProductRevenue collection in a bar chart:
On the Home tab, add a screen.]
On the Insert tab, select Charts, and then select Column Chart.
Select the middle of the column chart. Set the Items property of the column chart to
The column chart shows the revenue data from 2012:
In the column chart, select the center square:
On the Chart tab, select Number of Series, and then enter 3 in the formula bar:
The column chart shows revenue data for each product over three years: