# Bar Chart

The Bar Chart widget displays bar graphs. They represent numerical data in the form of vertical or horizontal bars, making it easier to compare different categories of data.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfEeucnteJYneqXOlX43m6j-wqIqyQ12HWWBVtoJxM5vokG2mD9MHvsLPvaaDcsLwOL-IVBc-JWt_G_jqB8DsCTKbDAlmLxnHWbLWbnwxZRMeP0vQzZkyqOD1AqxxrQ5fXRLBNHXw?key=ArGsMFxOZt6u_AfXAA-94iWG" alt=""><figcaption></figcaption></figure>

## Starting Widget Configuration

To configure the widget, click on the edit icon ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcmIxOieJTlc8fo1mAy0-zMLSjvIZaF4uzm3uAlqS5_2Gw5ZdeFRMU2ENOXmEMQLaIidAseTYETJDjEqu9B0svvJJ_TCwSbbL3v-3AgDHd-iPa4HllVCRDN9JzE1m3x9baoELO2og?key=nCUpXC2iKtVeq12Xi8RnWuyw).

<figure><img src="https://3237142148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FscP4BXwl9ufpJr5mfVln%2Fuploads%2Fgit-blob-2267af1e9805e21b22bd2154709c6967e88b1214%2Fbar.png?alt=media" alt=""><figcaption></figcaption></figure>

A pop-up window "Widget Settings" will open:

<figure><img src="https://3237142148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FscP4BXwl9ufpJr5mfVln%2Fuploads%2Fgit-blob-1c98745fd66f43d8bdc3a597c9e2ddec4f99c239%2F%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5%20(228).png?alt=media" alt=""><figcaption></figcaption></figure>

Fill in the necessary fields to configure the widget.

## **General Fields**

* **“Widget Name \*”** – a text field filled in manually from the keyboard;
* **“Mode”** – a drop-down list where you need to select the query creation mode for the widget:

| **Name**      | **Description**                                                                                                                                                                                                                                                                                                                    |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Builder Mode  | Allows you to build a query from separate blocks. Each block (Table Join, Filters, Widget Series, Group By, Sort, Number of Rows) has the option to configure the necessary commands for working with data, arithmetic and logical commands, comparison operators.                                                                 |
| Advanced Mode | <p>Allows you to enter a query manually in the SQL field:</p><p><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcd7OIaI1R6U2xJuYuo33WaYxtzln9tYAyEjwgkaFQvmWk9805MgjR88D_8QBjGAHjvMQvGc2LJSshFRdlLNMIMSC0Bnxvufy0eEUv9QIz2KAfRGIeFykHpvaX7g_W6kqH1KqmPQg?key=nCUpXC2iKtVeq12Xi8RnWuyw" alt="" data-size="original"></p> |

* **“Tables”** – a drop-down 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 drop-down list;
2. **“Operator”** from the drop-down list;
3. **“Column 2”** from the drop-down list;

For example,

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXciNHglBTDjXxh-ndG_wzNZcXhXND6XrUdgBCYtdVsfMv3TG6lbnmE7WNFThayemZauqrZI8azpsVmnyDFr53uPR-_7fNaoGFk-Hjobbh7QMjwunzzgtQqEHxZbkh_MB37n43DPnA?key=nCUpXC2iKtVeq12Xi8RnWuyw" alt=""><figcaption></figcaption></figure>

If you need to join more than two tables, you must click the button ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcROZ9y7XZhK1qwKQ5hLnMx37mm7idz56ag4ue9nmrltGiCm-UFL7NI3iN_E4hvVWPnflzHFtiCErCZms5wLZNi1FY5eeteFiTJdp9-Zy1PF4XsdmLbz7YpdWSk8R6ovdrAvfzGGQ?key=nCUpXC2iKtVeq12Xi8RnWuyw), after which you fill in the necessary fields.

If you need to delete a table join, you must click the button ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcsbV73oVpfuisxBad8hWyyeugetwarRT9Qin_QILnwD9umqNBWbO_ozoH6SbGFnkWDK2RvIW8keI5FkOlIIyyzy5QwrPSso1yRkSuG-5Kt2mo1vMGt0Id0NDy5gvYwIDa5ExuZOA?key=nCUpXC2iKtVeq12Xi8RnWuyw).

### **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 drop-down list;
2. **“Operator”** from the drop-down list;
3. **“Value”** manually from the keyboard;

For example,

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcESQzpRUvRZdAMxHUoIII1p7wTfua4vjT0iUyooGLAhmICxiBb7qbQNHKqzbKZApRuiZl_JMRVo-lO8IWZhCghO3l2fju0sa8YjMa5ezF3zNgXop6rlBWBg4oAqWcBRl9mySipdQ?key=nCUpXC2iKtVeq12Xi8RnWuyw" alt=""><figcaption></figcaption></figure>

If you need to combine multiple conditions into one, for example, ((robots.is\_deleted = 0) AND (robots.id > 13)), you need to use logical operators. To do this, select the desired operator by clicking on the icon ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe5KvLHwZJMAKEekEGvTPPxIYVtQHjZGWfT2q8JjIUdDQdSA06PBo1IP04AIcbYBakRwhkUhVD-sKW9jsuk3nkz5Ywch_4C4490VxIIDM4TnUldryGqRtx8FlU36Cs7yQZ5Fty8RQ?key=nCUpXC2iKtVeq12Xi8RnWuyw) to change it to OR, or ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe62e1PD1G48Sa7XfyhhOgn_81A4M0YGYMbslALy5hbSxgpT6ibxOtBHD1C_Ks5SzrvMmybTuKKtcIShyipyKAi-Dz9A5vI6zTIepF8g4XZXmtNZgAcOfyLjty0GYfxagnxE6l9?key=nCUpXC2iKtVeq12Xi8RnWuyw) to change it to AND. Then click the button ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcAFQBjH14gIfP5ZzErkhIp8i9YMCcDu5YAeWCq8Xy6W4K6J4t2-vTqJgtAW5TNFG50Vkm6jr3LvPF6ly9Cty2Yvk0AcxvBZnnVmRO4lVXOvioRgWTJewQCqeiTZN6CcOAjsT4jDw?key=nCUpXC2iKtVeq12Xi8RnWuyw), after which fill in the necessary fields:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcIYJZ9VjTOJzVfnAxrZdlAqQQ558qlI0bptyMwy5FBzipDgBIkz8TeFzIHSAXt4mQ215oiPVEVnOmMYy_M93Al92Ixcto6FY6tS360cqr2RvL_4RY7rCfGJWHmXBjZcptmC5fRNQ?key=nCUpXC2iKtVeq12Xi8RnWuyw" alt=""><figcaption></figcaption></figure>

If you need to set a complex condition for the Filter, including multiple parentheses, you must click the button ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfSfbBGhG7QVxO9ioVtoXWl8Rmt2U-9B6gKdfw0ai6VOgNahfB7RR8l3UlSXNeavIBlfT96eAhr9XtqT-BJj_Fi-ep4L91DH3ojUXNUBMcPq8aGBs8vUv-FktTvqrVOnLPVdZCK?key=nCUpXC2iKtVeq12Xi8RnWuyw), after which fill in the necessary fields.

If you need to delete a condition, you must click the button ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXd6OAWgEybohnm-V1e2pK4Z5R2yBziiiYj6BJ1ErR-ss_mBXRCxQllIK8ZF9cCs4_1coCLIq1xh_iucJN85kyIwN42FWOxA4wy4AycS4lt-awRGmfkEzeNAzOsRmNT3xbt6utzgog?key=nCUpXC2iKtVeq12Xi8RnWuyw).

### **Widget Series**

Widget series are used to specify the data columns that need to be extracted from the database. They determine 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 drop-down list;
2. **“Operator”** from the drop-down list;
3. **“Series Name”** manually from the keyboard;

For example,

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdcNclubdHr3t-XMCgO3_e1aV2WJOz73qmI4LnaCecZjFiDo9kL43waypLoOj2xa3ySVRrPersvZWBZ4y9lKTH_a3Ln9WNhcFN31-H_gbPQqp2qvk7nSdou3OOee_-WQDcMpzvF3w?key=nCUpXC2iKtVeq12Xi8RnWuyw" alt=""><figcaption></figcaption></figure>

If you need to display additional data on the legend, you should click the button ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeFhXqnbRswxTKAYx7LnYp-kO4Opn8ZIybkorP4LBC9jNkvphbYUS0BYkkPYvxYub1vP7rmYElV4uoHTg9Ofzw5INlNLUuWyOUXOkj2w0jhJqELB8Jh4iAMwh97fjd5IWR2fk5qFw?key=nCUpXC2iKtVeq12Xi8RnWuyw).

### **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 aggregate operations to be performed on these groups. To merge data rows, you need to fill in the column field from the drop-down list;

### **Sorting**

Fields for configuring the process of ordering data in the resulting 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 drop-down list;

### **Number of Rows**

The field is filled in manually from the keyboard or using the counter ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeptwsNfuXeBVsM5ITGuxu3Tk4Y-JS6u91ngfYj8jnBT8RRxSo09Eye1mhEKPaxYQQApQAA4g7ohGinnWFeznpGw9tkFSMqqmQZyL0AzL1jv9f3w_8Se6hCiwAb5JBjy2geuAxR?key=nCUpXC2iKtVeq12Xi8RnWuyw). This field allows you to limit the number of records returned in the query results for building the Dashboard.

## Testing

To ensure that the query is set up correctly, you need to click the button ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcbp8LyKi6t7wwKr6oCoZ7K1bg0aTKcf0j9tsfjgaSwf4hAwVarepSDi_1h6mapWcJVnG_6f2OV41rJuNM5NYM7LC7rlVLZYwX0TqKY3-T7exIoAfQTif6D2hrkSd3bB58_z7CZ?key=nCUpXC2iKtVeq12Xi8RnWuyw), after which a table with data will appear, based on which the Bar 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:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfEeucnteJYneqXOlX43m6j-wqIqyQ12HWWBVtoJxM5vokG2mD9MHvsLPvaaDcsLwOL-IVBc-JWt_G_jqB8DsCTKbDAlmLxnHWbLWbnwxZRMeP0vQzZkyqOD1AqxxrQ5fXRLBNHXw?key=ArGsMFxOZt6u_AfXAA-94iWG" alt=""><figcaption></figcaption></figure>

To display the sum of the maximum number of Queue repeats updated after 2023-03-23 at 11:27:52 on the Bar Chart Dashboard, you need to enter the following data in the corresponding fields in the "Widget Settings" window:

## Builder Mode (example)

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXekLJLvLOKkU-ipaF1buMOaMqB-hkoQUEF4puSj1fDDLO9PexSH2AL9br80cgUCtpcn0FHN95g9gwpnLqrjP_VPyXI-3_0Iq0f2cw154-pjlXUZ6Avf5k02f82RfBicfDuQPciYDA?key=ArGsMFxOZt6u_AfXAA-94iWG" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcw1u2x14fazNs3Y-04rQg10BHxL4lZWdchAX7RAdh9jDPMkp2vzUFdEr42JDd_adgcwVwAFQyRzosx5_IYbRxzsphXDE-ph9jAdAcYAik4Q0bTq7jXIyoARdkAb-pRFFB49oNoEQ?key=ArGsMFxOZt6u_AfXAA-94iWG" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdfqHzFZcAHdxwG18_81X2BYlyzcrz3zlPFRCg7KGENDKvs7AYLOWdqESYfEi9zxzo2X9VPv60J6x_dIFAbHkzB2mjH6dwIObKlOcZIPeqoO1qyrITUZChDN6e5WWj0tbBfSbbN4A?key=ArGsMFxOZt6u_AfXAA-94iWG" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf68VdLn5qd_gbflxiw-uCsFlDHQuE8nGvgoJahKyLktjSQ-UrCHrnuVZHjPlKWU1yy9ZJ1o4gZoVngNZpWKyYSVkYPc83Z5DCSm6k6Cmyghd09sz09cG9tR3Gv5XnoCfC1ATOh_w?key=ArGsMFxOZt6u_AfXAA-94iWG" alt=""><figcaption></figcaption></figure>

You need to fill in the fields:

**Tables \***

*queues*

**Filters**

| **Column**           |     |                       |
| -------------------- | --- | --------------------- |
| *queues.updated*     | >   | "2023-03-23 11:27:52" |
|                      | AND |                       |
| *queues.is\_deleted* | =   | 0                     |

**Widget Series**

| **Column**           |       | **Series Name** |
| -------------------- | ----- | --------------- |
| *queues.name*        |       | name            |
| *queues.max\_repeat* | *SUM* | *count*         |

**Group By**

*queues.updated*

## Advanced Mode (example)

You need to fill in the field:

**SQL**

```sql
SELECT
	queues.name AS name,
	SUM(queues.max_repeat) AS count
FROM
	queues
WHERE
	queues.updated > "2023-03-23 11:27:52" AND queues.is_deleted = 0 
GROUP BY
	queues.updated
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sherparpa.ru/en/sherpa-process-discovery/rabota-v-sherpa-process-discovery/ekrany/obzor/bar-chart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
