> 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/category.md).

# @category

Defines the column from the result set that will serve as the primary xAxis category or pie chart category.

## Quick Reference

```sql
-- @category: Month
```

## Valid Values

`One Of`

Must be a column name from the result set

## Full Example

```sql
-- @chart: Line
-- @title: Line - Sales by Month
-- @subtitle: An example line chart showing sales by month
-- @category: Month
-- @formats: currency
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%2FZOLyO3NNmymJh93BUq4o%2Fcategory_example.jpg?alt=media&amp;token=8d18efa5-c52d-440e-b166-c52267584e9a" alt=""><figcaption></figcaption></figure>

<details>

<summary>Sample Data</summary>

<img src="https://4045370218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB0xzzR5x0BnQ6kHixlzd%2Fuploads%2FIquQvZY1upyCHucJ0DZs%2Fcategory_example_data.jpg?alt=media&amp;token=cc23e9aa-098f-4c51-93ee-ef05899d7d8a" alt="" data-size="original">

</details>

## Use Cases

When you do not want the @category columns auto-detected, you specify @category to pick the particular columns that you want used on the main axis.
