> For the complete documentation index, see [llms.txt](https://docs.labii.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.labii.com/widgets/dashboard-widgets/reports/data-driven-charts/chart-by-category-x.md).

# Chart By Category X

## Overview

The "Chart By Category X" widget in the Labii dashboard is a powerful tool that offers versatile chart display options. This widget can generate charts based on counts or any column data, with the added flexibility of optional aggregation methods for category data. The widget utilizes a Select or ForeignKey widget to categorize data, allowing for customizable and informative visualizations that can be tailored to specific needs.

## Use case

* Display number of tasks to finish.
* Display number of customer closed.

## Configuration

To enable the widget, ensure that your setup meets the following requirements: have at least one column with a [Select](/widgets/column-widgets/form/dropdown.md#select) or [ForeignKey](/widgets/column-widgets/form/dropdown.md#foreignkey) widget, and one or more columns with a [Number](/widgets/column-widgets/form/text-inputs.md#number), [Formula](/widgets/column-widgets/calculation.md#formula) or [Consumption](/widgets/column-widgets/calculation/consumption.md) widget for aggregation analysis, which should return a numeric value. Once you've confirmed this, click the Edit button to configure the widget and proceed with the setup process.

* **Table** - Select a table to update the filter dropdown.
* **Query** - You can specify a query to limit the results.
* **X axis** - Choose a column for the X axis. If nothing is selected, the record name will be used as the X axis.
* **Series** - Choose one or more columns for the data series. Number, Formula or Consumption widgets must be used in the column. If no specific series is selected, the total count will be utilized as the data series by default.
* **Data aggregation** - Data aggregation is the process where raw data is gathered and expressed in a summary form. 'Sum' will be used if no specific series is selected.
  * None
  * Average
  * Max
  * Median
  * Min
* **Chart title** - Please provide the title of the chart.
* **Height** - Chart height in px. Default to 250px.
* **Should auto update** - If checked, this widget will perform a live calculation.
* **Should update when empty** - If checked, this widget will perform a live calculation when empty.

## Interface

The widget displays a bar chart where the x-axis represents either the count of records or a value derived from a specified aggregation method. The y-axis, on the other hand, represents the different categories within the dataset. Additionally, users have the option to click on the "**Download**" button to retrieve the source data in a downloadable format. This functionality ensures that users can easily access and analyze the underlying data that the bar chart represents.

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.labii.com/widgets/dashboard-widgets/reports/data-driven-charts/chart-by-category-x.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
