> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Text-to-Chart

> Generate charts from natural language prompts in ClickHouse Observability using the AI-powered Text-to-Chart feature.

The Text-to-Chart feature in ClickHouse Observability allows you to create visualizations by describing what you want to see in plain text. Rather than manually selecting metrics, filters, and group-by fields, you can type a prompt such as "Error counts by service over the last 3 days" and the AI Assistant will generate the corresponding chart automatically.

This feature uses a large language model (LLM) to convert your text prompt into a query, then builds the visualization in the [Chart Explorer](https://clickhouse.com/docs/clickstack/observability/features/dashboards/overview.md#navigate-chart-explorer).

## Prerequisites

A team admin must enable Generative AI in **Team Settings** under **Configure Generative AI**. See [Enabling Generative AI](https://clickhouse.com/docs/clickstack/observability/notebooks.md#enabling-generative-ai) for instructions. AI models and providers are managed automatically by the platform.

## Using Text-to-Chart

**1. Navigate to Chart Explorer**

Select **Chart Explorer** from the left sidebar.

**2. Select a data source**

Expand **AI Assistant** at the top of Chart Explorer if it is collapsed. Choose the data source you want to visualize from the selector beside the prompt field — for example, **Logs** or **Traces**.

![Chart Explorer with the AI Assistant expanded, Logs selected, and the Generate button](https://mintcdn.com/private-7c7dfe99/FqnhjwVWZILRZzw7/images/clickstack/observability-text-to-chart-explorer.png?fit=max\&auto=format\&n=FqnhjwVWZILRZzw7\&q=85\&s=820c65db245e5c364db9cb2363751070)

**3. Enter a text prompt**

In the **AI Assistant** prompt field, type a natural language description of the chart you want to create. For example:

* `Error counts by service over the last 3 days`
* `Latency breakdown by endpoint`
* `Count of events over time grouped by severity`

Click **Generate** to create the chart from your prompt. Review the generated configuration in the builder below. You can adjust the chart type, filters, and grouping, then click **Run** to update the visualization.

![Generated error counts by service chart with the AI Assistant prompt highlighted](https://mintcdn.com/private-7c7dfe99/FqnhjwVWZILRZzw7/images/clickstack/observability-text-to-chart-result.png?fit=max\&auto=format\&n=FqnhjwVWZILRZzw7\&q=85\&s=fda478ed13ed86a798ba051d8b7afccc)

## Example prompts

The following prompts demonstrate common use cases when working with observability data:

| Prompt | Data source | Description |
| - | - | - |
| `Error count by service over time` | Logs | Charts the frequency of errors across services |
| `Average request duration grouped by endpoint` | Traces | Shows latency patterns per endpoint |
| `P99 latency by service` | Traces | Identifies tail latency across services |
| `Count of 5xx status codes over the last 6 hours` | Logs | Tracks server error trends |

Prompts can reference any column or attribute available in your configured data sources. Include specific column names, filters, and time ranges to help the AI generate the chart you want.

## Limitations

* Only logs and traces are supported as data sources. Prometheus metrics are not yet supported.
* Chart accuracy depends on the clarity of the prompt and the structure of the underlying data. If a generated chart does not match expectations, try rephrasing the prompt or specifying column names explicitly.

## Further reading

* [Text-to-Dashboard](https://clickhouse.com/docs/clickstack/observability/text-to-dashboard.md) — generate a saved dashboard with multiple tiles from a prompt

* [From text to charts: a faster way to visualize with ClickStack](https://clickhouse.com/blog/text-to-charts-faster-way-to-visualize-clickstack) — blog post introducing the feature

* [Dashboards and visualizations](https://clickhouse.com/docs/clickstack/observability/features/dashboards/overview.md) — manual chart creation using Chart Explorer

* [Search](https://clickhouse.com/docs/clickstack/observability/features/search.md) — full-text and property search syntax
