* '''Use of color:''' Make sure to use label text that clearly explains the number. Do not rely on color alone to convey meaning. For example, negative numbers should have a qualifier (<code>-</code>) instead of just being formatted with a red background. {{WCAGref|use-of-color}}
* '''Use of color:''' Make sure to use label text that clearly explains the number. Do not rely on color alone to convey meaning. For example, negative numbers should have a qualifier (<code>-</code>) instead of just being formatted with a red background. {{WCAGref|use-of-color}}
* '''Screen readers''' read the KPI visual as a combination of current value and maximum value via an <code>aria-label</code> (for example, "A gauge showing 32670 of 100000 with label 'Sales Target Midmarket'"). {{WCAGref|text-alternatives}}
* '''Screen readers''' read the KPI visual as a combination of current value and maximum value via an <code>aria-label</code> (for example, "A gauge showing 32670 of 100000 with label 'Sales Target Midmarket'"). {{WCAGref|text-alternatives}}
'''KPIVisuals''' allows you to create meaningful dashboards that help evaluate the current status of quantitative information. With KPI visuals, you can compare a maximum value to a current value and visually show the difference.
== Adding KPI visuals ==
The following KPI visuals are available:
* KPI gauge
* KPI progress bar
* KPI tile
* KPI trend indicator
'''To add a KPI visual to a page:'''
{{ContentDropletSelect|KPI}}
See the examples on this page for information about each KPI visual type.
== Creating a KPI gauge ==
Use a KPI gauge when the metric has a meaningful range with three zones. You want to instantly judge where in that range the current value sits ("Is this in a good zone or bad zone?").[[File:Extension KPI Visuals - gauge.png|alt=KPI gauge for "Sales Target Midmarket" showing 32.7% with a red indicator|center|thumb|180x180px|KPI gauge]]
{| class="wikitable"
|+Example: Show the status of your sales goals
!Tab
!Parameter
!Description
|-
|Common
|Value
|Type in a fixed value (needs to be changed manually)
|(optional), e.g. <code>Sales Targets</code> ''(note that this field has no autocomplete function, so you need to know the exact full name of the page (including namespace prefix, if applicable)''
|}
== Creating a KPI progress bar ==
Use when the metric represents advancement toward a fixed goal. There is a clear start (0) and a clear finish ("How far have we gotten toward the goal?").
The target can go in either direction, e.g. you want to go towards 100% (closed tickets) or 0 (open tickets), depending on your view.[[File:Extension KPIVisuals - progress bar.png|alt=Progress bar showing 2 open tickets with a green indicator|center|thumb|200x200px|KPI progress bar]]
{| class="wikitable"
|+Example: Show open tickets (= pages with a "Status" property)
!Tab
!Parameter
!Description
|-
|Common
|Value
|Example: if you have a Property "Status" in your wiki, count the pages with value "in progress"<syntaxhighlight lang="text">
{{#ask:[[Status::in progress]] |format=count }}
</syntaxhighlight>
|-
|Common
|Label
|<code>Open tickets</code>
|-
|Advanced
|Maximum value
|Show all pages that have a value for the "Status" property:<syntaxhighlight lang="text">
When using tiles, you put the emphasis directly on the current snapshot value without visually indicating the comparison value ("Where are we right now?").
To create multiple tiles in a row, simply insert the KPI tiles multiple times on a page. You can copy and paste the first tile and simply change the necessary parameters for subsequent tiles.
[[File:Extension KPIVisuals - tile.png|alt=3 red green and yellow tiles for a total of 6 open tickets|center|thumb|650x650px|KPI tiles]]
{| class="wikitable"
|+Example: Show a tile for pages that have the SMW property "Status"
!Tab
!Parameter
!Description
|-
|Common
|Value
|Example: if you have a Property "Status" in your wiki, count the pages with value "in progress"<syntaxhighlight lang="text">
{{#ask:[[Status::new]] |format=count }}
</syntaxhighlight>
|-
|Common
|Label
|<code>New tickets</code>
|-
|Advanced
|Maximum value
|Show all pages that have a value for the "Status" property:<syntaxhighlight lang="text">
When using a trend indicator, you want to emphasize the fact that a value is improving or getting worse.
[[File:Extension KPIVisuals - trend indicator.png|center|thumb|96x96px|KPI trend indicator|alt=Green up-arrow with label "Sales trend" and value 50%]]
{| class="wikitable"
|+Example: Show the trend for sales scope B2B
!Tab
!Parameter
!Description
|-
|Common
|Value
|current value, e.g 50000
|-
|Common
|Baseline value
|reference value, e.g. 85000
|-
|Common
|Label
|<code>B2B</code>
|-
|Advanced
|Show difference
|''select the checkbox''
|-
|Advanced
|Show as percentage
|''select the checkbox''
|}
== Available parameters ==
Each KPI visual needs at least a value, a maximum value, thresholds where the color indicator changes and a label to identify the indicator.
{| class="wikitable"
|+
!
!Parameter
!Visualization
!Example
!Description
|-
|Common
|Value
|gauge, progress bar, tile, trend
|Can be calculated from an SMW property:<syntaxhighlight lang="text">
{{#ask:[[Status::open]]|format=count}}
</syntaxhighlight>Or from a [[Extension/Spreadsheets|spreadsheet cell]]:<syntaxhighlight lang="text">{{#sheetCell:Sales_data|E3}}</syntaxhighlight>{{Textbox|boxtype=note|header=Note:|text=The value needs to be an integer.|icon=no}}
[[mediawikiwiki:Help:Extension:ParserFunctions|Parser functions]] that result in an integer, e.g. <code><nowiki>{{#expr:4+5}}</nowiki></code> , are also supported.
|current numeric value to display (required)
|-
|
|
|
|
|
|-
|Common
|Label
|gauge, progress bar, tile, trend
|Any short label that describes the KPI visual.
|text label that is displayed below the indicator (optional)
|-
|Common
|Description
|tile
|Any text that describes the KPI visual.
|text description that is displayed below the value
|-
|Advanced
|Maximum value
|gauge, progress bar, tile
|Can be calculated from an SMW property:<syntaxhighlight lang="text">{{#ask:[[Status::+]]|format=count}}</syntaxhighlight>{{Textbox|boxtype=note|header=Note:|text=The value needs to be an integer.|icon=no}}
|links the KPI visual to a wiki page or an external page
|-
|Advanced
|Tolerance
|trend
|
|defines the neutral range
Example: 0.05 means ±5% difference from the baseline shows no trend.
|-
|Advanced
|Size
|trend
|<code>Medium</code>, <code>Small</code>
|size of visual indicator
|-
|Advanced
|Show difference
|trend
|adds a label below the graphic arrow (recommended for accessibility reasons)
|shows the difference between current value and baseline
|}
== Sources for values ==
Although values and maximum values can be manually maintained, it makes sense to automatically update the data. Here is a list of potential sources for values of type <code>integer</code>.
|[[mediawikiwiki:Help:Extension:ParserFunctions##expr|Parser function #expr]]
|<code><nowiki>{{#expr:20+50}}</nowiki></code>
|}
== Accessibility ==
* '''Use of color:''' Make sure to use label text that clearly explains the number. Do not rely on the color alone for conveying the meaning. For example, negative numbers should have a qualifier (<code>-</code>) instead of just being formatted with a red background. {{WCAGref|use-of-color}}
* '''Screenreaders''' will read the badge as a combination of current value and max value via an <code>aria-label</code> (for example, "A gauge showing 32670 of 100000 with label 'Sales Target Midmarket". {{WCAGref|text-alternatives}}
Latest revision as of 15:06, 10 November 2026
SkySapphire
KPIVisuals allows you to create meaningful dashboards that help evaluate the current status of quantitative information. With KPI visuals, you can compare a maximum value to a current value and visually show the difference.
See the examples on this page for information about each KPI visual type.
Creating a KPI gauge
Use a KPI gauge when the metric has a meaningful range with three zones. You want to instantly judge where in that range the current value sits ("Is this in a good zone or bad zone?").
KPI gauge
Example: Show the status of your sales goals
Tab
Parameter
Description
Common
Value
Type in a fixed value (needs to be changed manually)
(optional), e.g. Sales Targets(This field has no autocomplete function, so you need to know the exact full name of the page, including the namespace prefix, if applicable.)
Creating a KPI progress bar
Use a progress bar when the metric represents advancement toward a fixed goal. There is a clear start (0) and a clear finish ("How far have we gotten toward the goal?").
The target can go in either direction, depending on your view, e.g. towards 100% (closed tickets) or towards 0 (open tickets).
KPI progress bar
Example: Show open tickets (= pages in the category "Open tickets")
Tab
Parameter
Description
Common
Value
Number of pages in the category "Open tickets":
{{PAGESINCATEGORY:Open tickets}}
Common
Label
Open tickets
Advanced
Maximum value
Number of all pages in the category "Tickets":
{{PAGESINCATEGORY:Tickets}}
Advanced
Thresholds
0.3:green|0.5:yellow|0.8:red
Creating a KPI tile
Tiles put the emphasis directly on the current snapshot value without visually indicating the comparison value ("Where are we right now?").
To create multiple tiles in a row, insert the KPI tile multiple times on a page. You can copy and paste the first tile and change only the necessary parameters for subsequent tiles.
KPI tiles
Example: Show a tile for pages in the category "New tickets"
Tab
Parameter
Description
Common
Value
Number of pages in the category "New tickets":
{{PAGESINCATEGORY:New tickets}}
Common
Label
New tickets
Advanced
Maximum value
Number of all pages in the category "Tickets":
{{PAGESINCATEGORY:Tickets}}
Advanced
Thresholds
0.3:green|0.5:yellow|0.8:red
Creating a KPI trend indicator
A trend indicator emphasizes whether a value is improving or getting worse.
KPI trend indicator
Example: Show the trend for sales scope B2B
Tab
Parameter
Description
Common
Value
current value, e.g. 50000
Common
Baseline value
reference value, e.g. 85000
Common
Label
B2B
Advanced
Show difference
select the checkbox
Advanced
Show as percentage
select the checkbox
Available parameters
Each KPI visual needs at least a value, a maximum value, thresholds where the color indicator changes, and a label to identify the indicator.
links the KPI visual to a wiki page or an external page
Advanced
Tolerance
trend
defines the neutral range
Example: 0.05 means that a difference of ±5% from the baseline shows no trend.
Advanced
Size
trend
Medium, Small
size of the visual indicator
Advanced
Show difference
trend
adds a label below the graphic arrow (recommended for accessibility reasons)
shows the difference between current value and baseline
Sources for values
Although values and maximum values can be maintained manually, it makes sense to update the data automatically. Here is a list of potential sources for values of type integer.
Use of color: Make sure to use label text that clearly explains the number. Do not rely on color alone to convey meaning. For example, negative numbers should have a qualifier (-) instead of just being formatted with a red background. WCAG #use-of-color
Screen readers read the KPI visual as a combination of current value and maximum value via an aria-label (for example, "A gauge showing 32670 of 100000 with label 'Sales Target Midmarket'"). WCAG #text-alternatives