> 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

## 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="/files/WQgOpVgIlI8tPrFGt2dX" 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.
