Configure Statistics Widget
Define Statistics Widget
The Statistics widget of the Portal dashboard displays statistics and charts.
Below is a sample JSON definition of a statistics widget in the Portal dashboard
{
"type": "statistic",
"id": "statistic_1",
"name": "Tasks by Priority",
"layout": {
"styleClass": "new-widget",
"w": 5,
"h": 5,
"x": 0,
"y": 0
},
"chart": {
"id": "0",
"names": [{
"locale": "de",
"value": "Aufgaben nach Priorität"
}, {
"locale": "en",
"value": "Tasks by Priority"
}, {
"locale": "fr",
"value": "Tãches par priorité"
}, {
"locale": "es",
"value": "Tareas por prioridad"
}
],
"type": "TASK_BY_PRIORITY",
"filter": {
"timePeriodSelection": "CUSTOM"
}
}
}
The basic JSON structure of a statistics widget
type: type of the widget. Usestatisticfor a statistics widget
id: ID of the widget
name: Name of the widget on UI
layout: layout definition of the statistics widget
x: HTML DOM Styleleftis calculated as formulax / 12 * 100%
y: HTML DOM Styletopis calculated as formulay / 12 * 100%
w: HTML DOM Stylewidthis calculated as formula60 * w + 20 * (w - 1)
h: HTML DOM Styleheightis calculated as formula60 * h + 20 * (h - 1)
styleClass(optional): add CSS Classes to HTML DOM of the widget
style(optional): add inline style to HTML DOM of the widget
chart: the chart data model of the widget
id: the identification of the chart. It is an auto-generated UUID.
names: the display name of the chart. This allows for multi-language using the CMS and the user’s Locale.
type: type of chart such asTASK_BY_PRIORITY,CASES_BY_STATE,CASES_BY_FINISHED_TASK,CASES_BY_FINISHED_TIME,TASK_BY_EXPIRY,ELAPSED_TIME_BY_CASE_CATEGORY, andCASES_BY_CATEGORY
filter: list of filters to apply for each chart. Please refer to Portal.StatisticCharts for more information.