> For the complete documentation index, see [llms.txt](https://docs.chartsql.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chartsql.com/reference/directives/chart.md).

# @chart

Defines the type of chart like line, area, column, combo

## Quick Reference

```sql
-- @chart: pie
```

## Valid Values

Must be one and only one of the valid chart types supported by ChartSQL

`One Of`

* column
* bar
* pie
* line
* area
* combo

## Full Example

```sql
-- @chart: column
SELECT 
	TRUNC(date_closed, 'MONTH') as Month,
	sum(amount) as Sales
FROM sales
GROUP BY TRUNC(date_closed, 'MONTH')
ORDER BY TRUNC(date_closed, 'MONTH') ASC
```

<figure><img src="https://4045370218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB0xzzR5x0BnQ6kHixlzd%2Fuploads%2Fw4NfQO97MBsLQcjFou3a%2Fbasic_column_example.jpg?alt=media&amp;token=f324f552-5a3f-4e88-8e4c-c78dbc953902" alt=""><figcaption></figcaption></figure>

## Use Cases

When you want to specify the type of chart exactly, or the full auto-detection does not meet your needs, you use the @chart directive.

If you have not specified @category, @series or @secondary, they will be inferred from the columns in the result set.
