Skip to main content
Version: 1.21.3

Choice Timeline

The Choice Timeline widget is used in task forms of the Task (task) table and its child tables. It shows when and for how long a particular task was in different states, determined by options of a specific choice column.

Widget appearance

The widget consists of the following elements:

  1. Title.
  2. Legend – maps a specific color and state value. It displays only those states in which a record was.

  1. Start date and time – displays the start time of the work on a task.
  2. Total time spent in states – displays the total time spent in all non-excluded states.
  3. 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.

Set up the widget

The Timeline widget can be added to the Task table and tables extended from it. By default, it is not displayed on the form.

To display data on the time spent in different states, you need to add the widget to a form layout and configure option schema.

Add a widget to a form layout


To add the widget on a form, complete the following steps:

  1. Navigate to any table record you need to add the widget.
  2. In the burger menu, select Configure → Form → Layout.
  3. Move the Timeline widget from the Available box to the Selected box.
    • Click the widget name to set the schema options in the Schema options values field. Enter widget options in JSON format.
  4. Click Save to apply the changes.
note

If you do not configure the option schema, the widget will have default settings:

  1. Widget title = Timeline.
  2. Choice column = State.
  3. Color = Default set of 21 colors. When all 21 colors are used in a widget, subsequent colors are randomly generated.

Configure the options schema


Use the Widget Instance window to specify the widget options. Click the widget while configuring the layout to call this window.

In the window, fill in the Schema option values field. Enter the widget options in JSON format. If you leave the field empty, the default values are applied.

  1. Change the default title of the widget by defining the new one:
{
"title": "Title"
}
tip

It is better to use a title created in the Source Message (source_message) table, so that it has translations.

  1. Define a column of the Choice type:
{
"column": "column_name"
}
  1. 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 the following way:
{
"colorMap": [
{"color": "#123456", "value": "choice_option.value"
}
  1. Exclude some states not to display in the widget. Excluded states are displayed in gray. They occupy the minimum width and are not taken into account in the total time:
{
"excludedStates": "choice_option.value"
}

Widget example


The following options:

{
"title": "Task",
"column": "state",
"colorMap": [
{ "color": "#000000", "value": "1" },
{ "color": "red", "value": "-1" }
],
"excludedStates": ["-2", "7"]
}

configure 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.

note
  • 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.