# Intent and Its Role in Chart Generation

### **What is Intent?**

Intent represents the **primary objective** of your chart—it defines **what insights** the visualization should display. This is determined based on:

* **AI Builder:** Extracted from natural language prompts (*e.g., "Show sales by month"*)
* **Manual Drag-and-Drop Builder:** Inferred from **selected tables and columns**
* **SQL Data Explorer:** Derived from the **written SQL query**

Intent acts as the **foundation of your chart**, influencing data selection, SQL generation, and visualization type.

📌 *A well-defined intent ensures the system generates the most relevant and accurate chart for your needs.*

***

### **How Intent Affects Manual Chart Building & SQL-Based Charts**

For **Manual Builder and SQL Explorer**, intent is inferred **directly from the query and data sources**.

* If you select different **tables or fields**, the **intent automatically updates**.
* If the **SQL query changes**, the intent adjusts to match the new dataset.

#### **Changing Intent Triggers a Full Cycle Update**

When you modify the **intent**, the system follows a structured update process:

1. **Checks the Data Sources** – Ensures the relevant tables and columns are selected.
2. **Generates SQL** – Creates or updates the SQL query based on the new intent.
3. **Updates Data Components** – Adjusts the dataset, aggregations, and filters.
4. **Creates a New Visualization** – Automatically regenerates the chart to match the updated intent.

📌 *Changing the intent is a powerful way to refine your visualization without manually adjusting each component.*

***

### **How to Modify Intent in Chart Configuration**

#### **Steps to Update Intent**

1. Click on the **Intent field** at the top of the configuration page.
2. Modify the description to better match your desired chart output.
3. Click **Apply** to trigger the update cycle.

<figure><img src="/files/XOCrooyBy77f73rydnhD" alt=""><figcaption></figcaption></figure>

#### **When Should You Modify Intent?**

* If the **chart type doesn’t match** the expected visualization.
* If the **wrong data fields** are included in the dataset.
* If the **generated SQL query is incorrect or incomplete**.

📌 *By refining intent, you ensure that your chart aligns perfectly with your analytical needs.*

***

Intent is the **driving force** behind Infinity’s chart-building capabilities. Whether you're using **AI Builder, Manual Builder, or SQL Data Explorer**, defining and adjusting intent ensures that the system:

* Selects the **right data sources**
* Generates **optimized SQL queries**
* Constructs **accurate, insightful visualizations**

🚀 **Next, we’ll dive into how to modify data sources and tables for further customization.**


---

# 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.getinfinity.app/user-guide/comprehensive-user-guide/2.-charts/chart-customization/intent-and-its-role-in-chart-generation.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.
