How is sorted data ordered when option fields or categories are specified for the "Group by" option in a chart's settings?
This page explains how data will be ordered when you sort it by specifying option fields or categories for the Group by option on the Graph settings screen.
The following fields are classified as option fields.
- Radio button
- Drop-down
- Check box
- Multi-choice
If you specify an option field
If you specify one of the above fields for Group by on the Graph settings screen and sort data, the data included in the chart will be displayed in the order specified under Options in the field's settings.
For example, suppose you have configured the following settings in your app.
- You have a Drop-down field with the options "A", "C", and "B" listed in that order under Options in the field's settings.
- You have a chart with the following settings.
- Chart type: Bar chart, Clustered
- Group by (Level 1): Drop-down
- Function: Count (Number of Records)
- Sort by: Level 1, Ascending
With the above settings, your chart will display data in the following order.
- Drop-down: A
- Drop-down: C
- Drop-down: B
If you specify categories
If you specify categories for the Group by option on the Graph settings screen and sort data, the data in the chart will be listed in the order defined in the category tree. If you reorder categories in your category tree after they have been created and saved, the order will not change.
Also note that if you added multiple categories at one time and saved them, they will be listed in the order they were in when they were saved, not when they were added.
For example, suppose you have configured the following settings in your app.
- You have a category tree with the categories "1", "3", and "2" listed in that order.
- You have a chart with the following settings.
- Chart type: Bar chart, Clustered
- Group by (Level 1): Categories
- Function: Count (Number of Records)
- Sort by: Level 1, Ascending
With the above settings, your chart will display data in the following order.
- Category: 1
- Category: 3
- Category: 2