[Yandex Cloud documentation](../../../index.md) > [Yandex DataLens](../../index.md) > [Charts](index.md) > QL charts > Overview

# QL charts in Yandex DataLens. Overview


_QL charts_ are charts created from a connection if the connection source is a database, Prometheus, or Monitoring. To create such charts, one uses direct queries to the source. Depending on the chart type, the query can be run in the source database's SQL dialect, as well as the Prometheus or Monitoring query languages. This helps you to expand visualization capabilities by using language-specific transactions.


Running a query does not create a separate [dataset](../../dataset/index.md) object: a chart is generated on the fly and displayed in the preview panel.

Unlike [dataset-based charts](dataset-based-charts.md), the logic of a visualization area in QL charts favors queries against the source, i.e., the visualization area only displays the data from the query. You can also save QL charts and [add](../../operations/dashboard/add-chart.md) them to dashboards as widgets.



{% note alert %}

If users are granted [permission to view](../../security/manage-access.md#permission-read) your QL chart, they will be able to make any queries to any source data of this QL chart.

When using QL charts, configure access restrictions on the data source side.

If you need to [restrict access at the data row level (RLS)](../../security/row-level-security.md), use [dataset-based charts](dataset-based-charts.md).

{% endnote %}

The following types of QL charts are supported:

* **SQL**. These allow you to build visualizations with flexible dataset management based on parameterization of an SQL query to the source DB.

  SQL charts:

  * Reduce database workload by using direct queries.
  * Are only suitable for `SELECT` queries.
  * Enable the use of `JOIN`, `GROUP BY`, and `SORT BY` queries and aggregation functions in SQL queries.
  * Enable the parameterization of any part of a SQL query.
  * Support a limited set of [visualizations types](../../visualization-ref/index.md).
  * Do not support [RLS](../../security/row-level-security.md) and [calculable fields](../calculations/index.md).

    {% cut "Example of a ClickHouse® database query" %}
    
    ```sql
    SELECT Category, Month, ROUND(SUM(Sales))
    FROM samples.SampleLite
    WHERE Category in not_var{{category}} -- Variable used in the selector
    GROUP BY Category, Month -- Grouping by category and month
    ORDER BY Category, Month -- Sorting by category and month
    ```
    
    {% endcut %}


* **Prometheus**. These allow you to create a chart based on Prometheus. You cannot build a dataset on top of this source. You can only work with it using QL charts.

  {% cut "Example of a query for Prometheus" %}
  
  ```sql
  sum by (name) (rate(container_cpu_user_seconds_total{container_label_org_label_schema_group="monitoring"}[1m]) * 100  / scalar(count(node_cpu_seconds_total{mode="user"})))
  ```
  
  {% endcut %}

* **Monitoring**. These allow you to create a chart based on Yandex Monitoring. You cannot build a dataset on top of this source. You can only work with it using QL charts.

  {% cut "Example of a query for Monitoring" %}
  
  ```json
  {project="monitoring", sensor="nodejs.heap_space.size.bytes"}
  ```
  
  {% endcut %}

{% note warning %}

Access permissions for QL charts based on Monitoring and Prometheus data are managed both on the DataLens side and in Monitoring and Prometheus.

To view a chart in DataLens, the user needs chart access and connection permissions, as well as permissions to read data from a specific Prometheus API or project in Monitoring.

{% endnote %}



To create a QL chart, follow [this guide](../../operations/chart/create-sql-chart.md).


## Use cases {#examples}

* [Examples of creating QL charts](../../tutorials/data-from-ch-to-sql-chart.md)


#### See also {#see-also}

* [Creating a QL chart in Yandex DataLens](../../operations/chart/create-sql-chart.md)
* [Yandex DataLens chart](index.md)
* [Creating a chart in Yandex DataLens](../../operations/chart/create-chart.md)

_ClickHouse® is a registered trademark of [ClickHouse, Inc](https://clickhouse.com)._