Choice Timeline
The Choice Timeline widget is used in task forms of the Task (task) table and its child tables. By default, it is not displayed on the form. It shows when and for how long a particular task was in different states, determined by options of a specific choice column.
See the Add Widget to Form article for the information on how to add a widget to a form.
Widget interface
The widget consists of the following elements:
- Title.
- Legend – maps a specific color and state value. It displays only those states in which a record was.
- Start date and time – displays the start time of the work on a task.
- Total time spent in states – displays the total time spent in all non-excluded states.
- End date and time – displays the time when the work on a task was completed. The task should be in inactive mode (Active = false).
The order of segments corresponds to the order in which state values changed. Also, the width of the segment corresponds to the time spent in a certain state relative to the total time.
When you move the pointer over a segment, a window appears, showing the state and the time spent in this state. If the time is less than 1 minute, <1m is displayed.
Below, the start and end times of this state are displayed. If the current state is the last segment, Now is displayed instead of the end time.
Configure the widget
If you do not configure the value of the widget options, the widget will have default settings:
- Widget title = Timeline.
- Choice column = State.
- Color = Default set of 21 colors. When all 21 colors are used in a widget, subsequent colors are randomly generated.
To configure the values of the widget options, complete the following steps:
-
In the burger menu of the form where the widget is located, select Configure → Form → Layout.
-
In the Selected box, find the widget you need to configure. Click the icon to the right of the widget title.
-
In the Configure the value of the widget options modal window that appears, specify the widget parameters in JSON format.
Configure the value of the widget options{
"title": "Task",
"column": "state",
"colorMap": [
{ "color": "#000000", "value": "1" },
{ "color": "red", "value": "-1" }
],
"excludedStates": ["-2", "7"]
}-
title – specify the widget title. It is better to use a title created in the Source Message (source_message) table to add translations to it.
-
column – define a system name of a Choice type column. The widget will display the time a record spent in different choice options of this column.
-
colorMap – the widget color scheme.
- color – the color that corresponds to the specified value option of the column. If you need to use a color that is not included in the list of default colors for a particular choice option, specify it in HEX color.
- value – the value of the choice option that corresponds to the color.
-
excludedStates – the choice options the time in which must not be displayed in the widget. Excluded options are displayed in gray. They occupy a minimum width and are not counted in the total time.
-
The options from the example display the following widget:
Additional information
The widget is displayed only on the created records. The state change data is taken from the History (sys_history) table, the state data and state translations are taken from the Choice Options (sys_choice) table.
- If there are option values in the History (sys_history) that are not in the option set for the current child of the Task table, the widget looks for a matching set of the nearest parent of this table (if there is any).
- If there is no state in the Choice Options (sys_choice) for the current table, the widget accesses the parent table states.
- If there are no translations or the state itself, a value of the state from sys_history is displayed.