Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Create Piechart from unknown numer of different labels

Featured Replies

Without using SQL (that i find cumbersome) I would like to create a Pie chart, with a dynamically list of labels (?!)

I want to do a small analytics using FM. My App, using the FM API, creates a record putting in the FM field "OSversion" the OS system they run in (that can be various, iOS 9.3, 10.1, 11.2, etc)

I am struggling to come up, without looping trough the records, for a calculated field that gives me what i need for the PieChart: that is the total of each iOS version return delimited, no matter how different and how many they could be..

For the labels I can use off course a List from the field "OSversion".

But for the totals, I cannot use relationships, since the next record could be a value (say 14.5) that I did not plan to have.

Is it there a solution?

Thanks

21 minutes ago, trevix said:

I am struggling to come up, without looping trough the records, for a calculated field that gives me what i need for the PieChart: that is the total of each iOS version return delimited, no matter how different and how many they could be..

You could simply use a summary field defined as Count of [ OSversion ] (or any field that cannot be empty). Define the chart to use data from the current found set, with the option to summarize groups of records when sorted. Use the OSversion field as the category labels and the summary field as the slice data.

To produce the chart, sort the records by OSversion, with reorder based on the summary field (descending).

 

  • Author

Opps. Sorry.

I forgot to mention that I am putting together a sort of dashboard.

So there are other values (and PieChart), similar to the one I mentioned: like App version, Hardware type, language and similar.

Beside the time it would take, I would then need multiple sort followed by a set field with the results; almost the equivalent of doing loops. Suppose there are thousands of records...

One thing that baffles me is that, creating a relationship between the "OSversion" field and itself, a subsequent count calculated field and using this as the second field for the List, I can clearly see the total for each value of "OSversion", in the list (see screenshot). I wonder if it is possible to extract it...

Schermata 2020-01-07 alle 18.02.56.png

Are you familiar with the Fast Summaries method by Mikhail Edoshin?

 

  • Author

Will google it. Thanks

But do you think I would be much better learning how to SQL?

I think having at least a rudimentary knowledge of SQL would be an advantage. That said, I believe that you should exhaust the native methods before reaching for SQL.

 

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.