Stat
Shows a metric with an optional change and sparkline.
When to use
- Use one tile for a measure people check frequently.
Examples
A single metric
Loading the example
<k:Stat label="Open shipments" value="56"/>Lead time and its trend
Loading the example
<k:Stat label="Average lead time" value="4.8" decimals="1" unit="days"
delta="-12" upIsGood="false" note="Compared with last week" trend="{/days}" press=".onPress"/>sap.ui.define(["sap/ui/core/mvc/Controller", "kor/ui/Toast"], (Controller, Toast) => Controller.extend("sample.LeadTimeStat", {
onPress() {
Toast.show("Average time from packing to delivery");
}
}));API
Properties
| Name | Type | Default | Description |
|---|---|---|---|
label | string | Metric label | |
value | float | 0 | Numeric value |
decimals | int | 0 | Number of decimal places |
unit | string | Unit | |
delta | float | 0 | Percentage change. Zero hides the change |
upIsGood | boolean | true | Whether an increase is favorable |
note | string | Explanation of the change | |
trend | object | Values for the sparkline | |
hero | boolean | false | Whether to use the larger presentation |
Events
| Name | Type | Description |
|---|---|---|
press | The metric was pressed |