cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
roknron
Level: Powered On

how to load pie chart when the application begins to run

I have an app that was created to track task catagories and the time spend on each catagory.  The pie is presneted correctly but it will not load when the app initially runs.  I have to either go to the new record screen and cancel or select the record edit screen then return to the browseGallery screen for the pie to be displayed.  In the onVisible property of the Gallery control a collection is created an agregate column and the pie chart card item property is set to the new agregate column in the collection.  How do I cause the pie to be generated at applicaton load?

 

Ron

3 REPLIES 3
Community Support Team
Community Support Team

Re: how to load pie chart when the application begins to run

Hi Ron,

 

If you create a new similar app, will this issue reproduce?

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mr-dang
Level 10

Re: how to load pie chart when the application begins to run

Limitation: When you set the Items property of a Pie Chart to a Collection, you will have to add data into the Collection before anything shows up. Also, if you want to change any data to the Pie Chart, that requires you to recollect it to reflect changes.

 

As an alternative, the Table() function is perfect for the Items property of the Pie Chart because it show real-time data. You do not need to recollect data. It's probably the most underrated function in PowerApps since connected datasources are emphasized so much.

 

Below is an example of a formula used to summarize the level of proficiency of students as a whole:

Table(
	{label: "Advanced", num: CountRows(Filter(datasource,Score>=90))},
	{label: "Proficient", num: CountRows(Filter(datasource,Score<90 && Score>=80))},
	{label: "Basic", num: CountRows(Filter(datasource,Score<80 && Score>=70))},
	{label: "Below", num: CountRows(Filter(datasource,Score<70))}
)

Each record in a table is wrapped between curly brackets {}. Each record is separated by a comma. Within each record, each column includes its name, a colon, and its value.

 

The pie chart above expects 4 slices. The slices are named by the "label" column. The size of each slice is set to the "num" column. Rename things to your needs. 

 

If I add or remove any records from datasource, the changes will be immediately reflected in the Pie Chart since Table() is dynamic.

Microsoft Employee
@8bitclassroom
roknron
Level: Powered On

Re: how to load pie chart when the application begins to run

That's pretty cool. but, my lables are contained within the datasource and the agregate column that currently is in the contorl item property.  How do I apply this table formula to that situation?

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 195 members 5,492 guests
Recent signins:
Please welcome our newest community members: