StatTile Documentation
Overview
The StatTile component is a powerful visualization tool within the Vantage analytics platform that provides users with an at-a-glance view of key metrics. This component supports multiple data visualizations such as big numbers, comparisons against targets, and visual trends through sparklines. StatTile is suitable for dashboards and analytics interfaces where recognition of performance indicators is crucial.
Purpose
The primary function of StatTile is to encapsulate a metric (primary measure), provide contextual comparisons, and render this data visually. It fetches data from workflows, performs calculations according to specified settings, and updates the interface dynamically based on user interaction and data changes.
Data Expectations
StatTile expects the following data structure:
- Primary Measure: A specified metric that the tile will visualize.
- Comparison: Additional data to compare against the primary measure (e.g., previous values or target values).
- Sparkline: Optional data used for trend analysis visualized as a small line chart.
- Health: Information regarding the status of the primary measure, dictating its visual presentation (color changes based on thresholds).
- Workflows: Array of workflow references from which the data is fetched.
Settings
Primary Measure
- Name:
primaryMeasure - Input Type: Object
- Description: Contains information about the primary metric to be displayed. This includes the workflow ID, field name, aggregation method, and formatting option. Changing this can affect what metric is displayed.
- Default Value:
{}(no primary measure set)
Comparison
- Name:
comparison - Input Type: Object
- Description: Controls the comparison functionality. This includes settings for enabling the comparison, type of comparison (target vs previous period), and the field to compare against. Modifying this allows users to adjust the type of comparison to display.
- Default Value:
{}(no comparison set)
Sparkline
- Name:
sparkline - Input Type: Object
- Description: Enables the display of a sparkline for trend analysis. It includes a field reference for the date and indicates whether the sparkline should be shown. Adjusting this affects the visual trend representation.
- Default Value:
{}(no sparkline set, defaults to disabled)
Health
- Name:
health - Input Type: Object
- Description: Defines the health indicators for the primary measure, including thresholds for critical and good statuses. It can also define if these should influence background color or text color, affecting the visual cue given by the StatTile.
- Default Value:
{}(no health status set)
Workflows
- Name:
workflows - Input Type: Array
- Description: Lists the workflows from which data is fetched. It can influence the range of metrics available and determine which data sets can be displayed in the StatTile. Altering this changes the data source for the tile.
- Default Value:
[](no workflows listed)
Visualization Type
- Name:
visualizationType - Input Type: String
- Description: Specifies the type of visualization to render (e.g., 'stat', 'bignumber', 'smallnumber'). Changes to this setting dictate how the statistical information is presented visually.
- Default Value:
'stat'
Use Cases & Examples
Use Case 1: Sales Performance Monitoring
A company may use StatTile to display the latest sales figures (primary measure) along with a comparison to last month's target sales. This provides immediate insight into performance and progress.
Use Case 2: Operational Health Dashboard
In operational contexts, StatTile can be employed to show the health of system metrics (like server uptime) with critical and good status ranges highlighted. By integrating health comparisons, it enhances alertness for fallback thresholds.
Example Configuration
For a sales dashboard, the StatTile might be configured like this:
{
"primaryMeasure": {
"field": {
"workflowId": "sales_workflow",
"field": "current_sales",
"label": "Current Sales"
},
"aggregation": "sum",
"format": "currency"
},
"comparison": {
"enabled": true,
"type": "target",
"targetField": {
"workflowId": "sales_workflow",
"field": "target_sales"
},
"display": "absolute"
},
"sparkline": {
"enabled": true,
"dateField": {
"field": "sales_date"
}
},
"health": {
"enabled": true,
"critical": 1000,
"good": 5000,
"target": "background"
},
"workflows": ["sales_workflow"],
"visualizationType": "bignumber"
}In this example, the StatTile is configured to show the cumulative sales figure from a specific workflow, provide an absolute comparison against a target sales figure, and incorporate a sparkline of sales trends over time while indicating health status with visual cues based on predefined thresholds.