Microflow count as source for chart

0
I created a soccer-app and have a page where I want to show some statistics of all past games. What i want to do is show the percentage of games won in a chart (pie, progress, ...) → My entity ‘Game’ does NOT contain an attribute ‘AmountGamesWon’. → I created a microflow that retrieves a list of all games, filters it, and counts the games that we won. The microflow returns an integer ($Count). In my statistics page, can I use this $Count as an input for a Chart?
asked
1 answers
0

Yes, you can. Charts usually have a series of data. Yours only contains one element, so you will have to wrap your single data object in a list and supply that to the chart. If you want to make it easier one yourself, then use the piechart and supply it a list of [{“gameswon”: 10}, {“gameslost”: 6}]. That way, it will automatically show you the percentage. See https://mydemoversion8-sandbox.mxapps.io/p/charts for an example.

answered