Overview
A Bar Chart uses horizontal bars to compare record counts. In the Actions by Site and Status example, each bar shows the total number of actions at a site. The coloured segments show how many actions are Overdue, Due Soon, On Track or Closed.
Start with one bar per site, then add a status breakdown, customise the legend labels and assign the colours. You can also configure click-through so users can select a segment to see the records it counts.
Contents
- Create one bar per site
- Add a status breakdown
- Use descriptive legend labels
- Set the colours with Named Styles
- Show or hide a status series
- Configure and test click-through
- Other Bar Chart settings
Create one bar per site
Choose a Field that identifies the category for each record. This example uses Site, with values such as Bristol, Leeds and Manchester. Populate the Field on the records you want to count.
- In App Studio, open your App and go to Reports → Charts → Add.
- On the Add a report page, find Bar and select Create. You can also find the card by selecting Bar in Filter types.
- In Basic Information, enter Actions by Site and Status as the Title and give the Report a unique Identifier. The Report Type is Chart and the Chart Type is Bar.
-
Expand Chart Fields, select Add Chart Field, enter the settings below and select OK.
Setting Value Chart Field Type Y Field Site [Site] Label Site - Select Save, publish the App and open the Report in Workspace. Each site appears as one horizontal bar, with Record Count along the bottom. In this example, Bristol has 7 actions, Leeds has 6, and Manchester has 8.
For shared settings such as Sub Title, Report Folder, default Report behaviour and hiding a Report, see Basic Report Configuration.
Add a status breakdown
Add an X Chart Field to split each site’s bar into status segments. In this example, the Status Multi-State Field supplies both the legend labels and the segment colours automatically.
- In the Bar Chart’s Chart Fields section, select Add Chart Field.
- Set Chart Field Type to X, select the Status Multi-State Field under Field, and enter Status as the Label. Keep Site configured as Y.
- Save the Report and publish the App.
Workspace shows one stacked bar per site. The legend displays the Multi-State values Amber, Black, Green and Red, and the segments use the corresponding state colours.
Use descriptive legend labels
To show Overdue, Due Soon, On Track and Closed in the legend, add a calculated Text Field labelled Status Label with the Identifier StatusLabel.
The Action Tracker uses this expression to map its Status Multi-State values to descriptive labels. If your Field Identifier or state values differ, update the expression to match your App.
if([Status] = 'Red', 'Overdue',
if([Status] = 'Amber', 'Due Soon',
if([Status] = 'Black', 'Closed',
if([Status] = 'Green', 'On Track', '')
)
)
)The expression returns a blank for any other value. Check that your records have a Site and that Status Label returns the expected text.
In Chart Fields, edit the X Chart Field and change Field to Status Label [StatusLabel]. Keep its Label as Status. The values returned by the calculated Field supply the individual legend entries.
| Chart Field Type | Field | Label | What it controls |
|---|---|---|---|
| X | Status Label [StatusLabel] | Status | The status series shown in the legend and within each bar |
| Y | Site [Site] | Site | The site categories listed down the left of the chart |
App Studio · Status Label is configured as X and Site is configured as Y.
Save the Report and publish the App. The legend now shows the descriptive labels. The chart uses its default palette until you apply a colour style.
Set the colours with Named Styles
Apply a Value Style to assign a colour to each legend label.
- In App Studio, go to Styles, add a Style and select Value. Give it a name, such as Action Tracker status colours.
-
Select Add Value Style for each status. In Name, enter the exact text returned by Status Label. In Value, choose the corresponding colour.
Name Value Overdue Red Due Soon Amber On Track Green Closed Black - Save the Style.
- Open the Bar Chart, expand Named Styles and select Add Named Style.
- Select Value, choose Action Tracker status colours in Style, and set Element to Chart Series. Select OK and save the Report.
- Publish the App and open the chart in Workspace. Check that the legend and bar segments use the colours shown at the start of this article.
For more about creating and applying Value Styles, see Styles.
Show or hide a status series
In Workspace, click a status in the chart legend to hide its series. Click the same entry again to show it. In the example below, Closed and On Track are hidden, so the bars show only Due Soon and Overdue counts.
Legend selections are temporary. All series are shown again when you refresh or reopen the Report.
Configure and test click-through
Set a target Table Report so users can open the records behind a bar or segment.
- In the Bar Chart’s Basic Information, set Target Click Through Report to the Table Report you want users to open. In this example, select Action Tracker [ActionTracker].
- In the destination Table Report, include the details users need to follow up, such as Action ID, Action, Action Owner and Due Date.
- Save your changes and publish the App.
Check that the counts match
- In Workspace, open Actions by Site and Status and hover over Bristol’s red Overdue segment. The tooltip shows Overdue: 2.
- Click the same segment to open the Action Tracker Table Report.
- Open the Filter pane and look under Additional Filter. For this segment, the criteria are Status Label = Overdue and Site = Bristol.
- Compare the tooltip count with the total after the slash in the Table Report footer. The footer shows 1–2 / 2, confirming that the Table Report contains the same two records counted by the segment.
If the counts differ, check Additional Filter to confirm the site and status. Then check whether the destination Report’s Base Filter or other active filters exclude records counted by the chart.
Tip. If the destination Table Report uses coloured status indicators, add a key to its Sub Title. For example, 🔴 Overdue 🟡 Due Soon 🟢 On Track ⚫ Closed.
Other Bar Chart settings
| Setting | What it does |
|---|---|
| Height | Sets the chart height in pixels. Increase it if you need more room for the category labels or legend. |
| Chart Sort Field Order | Uses the Field’s natural order, such as its configured display order where available. When disabled, values sort alphabetically by their display format. |
| Background Image URI | Displays an image behind the chart. You can use it to indicate zones or add branding. |
| Base Filter | Limits the records the chart counts. Searches and filters applied in Workspace narrow that set further. |
| HoverText | A Chart Field Type for adding descriptive Field text to the information shown on hover. |
| In-App Data Source Field | Selects a Grid Field for chart types that support Grid data. Leave it blank for the Action Tracker record-count examples. |
| Visibility | Controls which Users or Teams can see the Report. |
Comments
0 comments
Please sign in to leave a comment.