LINE CHART#

The Line Chart widget displays line graphs. It can display multiple lines on one chart, allowing for the comparison of different metrics.

Getting Started with Widget Configuration#

To configure the widget, click on the edit icon .

A popup window "Widget Settings" will open:

Fill in the necessary fields to configure the widget.

General Fields#

  • “Widget Name *” – a text field filled in manually from the keyboard;
  • “Mode” – a dropdown list where you need to select the mode for creating a request for the widget:
Name Description
Builder Mode Allows you to build a request from separate blocks. Each block (Table Join, Filters, Widget Series, Group By, Sort, Row Count) has the option to configure the necessary commands for working with data, arithmetic and logical commands, comparison operators.
Advanced Mode

Allows you to enter a request manually in the SQL field:

  • “Tables” – a dropdown list with all available database tables.

Additional Fields Available for Configuration Only in Builder Mode#

Table Join#

Table joins are necessary to extract data from multiple related tables and form more complete and informative results.

To compare two tables for subsequent joining, the following operators are used:

Name Description
= Returns rows from both tables where the values in the specified columns are equal.
!= Returns rows from both tables where the values in the specified columns are not equal.
> Returns rows where the value in the specified column from the first table is greater than the value in the specified column from the second table.
< Returns rows where the value in the specified column from the first table is less than the value in the specified column from the second table.

If you need to join only 2 tables, you must fill in the fields:

  1. “Column” from the dropdown list;
  2. “Operator” from the dropdown list;
  3. “Column 2” from the dropdown list;

For example,

If you need to join more than two tables, you must click the button , after which you need to fill in the necessary fields.

If you need to delete a table join, you must click the button .

Filters#

Filters allow you to set conditions for the selected data using comparison operators and logical operators.

To set one condition, you need to fill in the fields:

  1. “Column” from the dropdown list;
  2. “Operator” from the dropdown list;
  3. “Value” manually from the keyboard;

For example,

If you need to combine several conditions into one, for example, ((robots.is_deleted = 0) AND (robots.id > 13)), you must use logical operators. To do this, select the desired operator by clicking on the icon to change it to OR, or to change it to AND. Then click the button , after which fill in the necessary fields:

If you need to set a complex condition for the Filter, including several parentheses, you must click the button , after which fill in the necessary fields.

If you need to delete a condition, you must click the button .

Widget Series#

Widget series are used to specify the data columns that need to be extracted from the database. They define which data will be returned in the query results.

To configure the Widget Series, you need to fill in the fields:

  1. “Column” from the dropdown list;
  2. “Operator” from the dropdown list;
  3. “Series Name” manually from the keyboard;

For example,

If you need to display additional data on the legend, you should click the button .

Group By#

Field for configuring the process of merging data rows with the same values in a specific column (or columns) into a single set, allowing for aggregate operations on these groups. To merge data rows, you need to fill in the column field from the dropdown list;

Sorting#

Fields for configuring the process of ordering data in the result set in a specific order based on the values in one or more columns. To sort in ascending order, you need to enter "ASC" in the "Sort By" field. To sort in descending order, enter "DESC". Then you need to fill in the "Column" field from the dropdown list;

Row Count#

The field is filled in manually from the keyboard or using the counter . This field allows you to limit the number of records returned in the query result for building the Dashboard.

Testing#

To ensure that the request is set up correctly, you need to click the button , after which a table with data will appear, based on which the Line Chart Dashboard will be built.

To display the Dashboard on the panel, click the "OK" button.

To delete all filled data, click the "Cancel" button.

Example:

To display a chart showing the top 10 Queues with the highest number of Tasks, you need to enter the following data in the corresponding fields in the "Widget Settings" window:

Builder Mode (Example)#

You need to fill in the fields:

Tables *

queues

tasks

task_statuses

Table Join

Column Operator Column 2
queues.id = tasks.queue_id
tasks.status = task_statuses.code

Widget Series

Column Series Name
queues.name name
tasks.id COUNT count

Group By

queues.name

Row Count

10000

Advanced Mode (Example)#

You need to fill in the field:

SQL

SELECT
	count(tasks.id) AS count,
	queues.name AS name
FROM
	queues LEFT JOIN tasks ON queues.id=tasks.queue_id
	LEFT JOIN task_statuses ON tasks.status=task_statuses.code
WHERE
	queues.is_deleted=0 AND tasks.is_deleted=0
GROUP BY
	queues.name
LIMIT 10000