# Bar Chart
> Vertical bar charts for comparing values across categories
Source: https://shellui.dev/docs/v0.3/components/advanced/charts/bar-chart
The `BarChart` component renders vertical bar charts ideal for comparing discrete values across categories. Built on **ApexCharts.Blazor** with full ShellUI theme integration.
## Installation
```bash
shellui add chart bar-chart
```
`chart` and its styles are installed as dependencies, and the `Blazor-ApexCharts` NuGet package is added for you.
## Basic Usage
```razor
@code {
private List salesData = new()
{
new("Jan", 12000), new("Feb", 19000),
new("Mar", 15000), new("Apr", 25000),
new("May", 22000), new("Jun", 30000)
};
record SalesData(string Month, decimal Revenue);
}
```
## With Colorful Theme
```razor
@code {
private List budgetData = new()
{
new("Engineering", 250000),
new("Marketing", 120000),
new("Sales", 180000),
new("Support", 95000),
new("Design", 110000)
};
record DepartmentBudget(string Department, decimal Amount);
}
```
## Monochrome Theme
```razor
@code {
private List quarterlyData = new()
{
new("Q1 2024", 45000), new("Q2 2024", 52000),
new("Q3 2024", 48000), new("Q4 2024", 61000)
};
record QuarterlyData(string Quarter, decimal Revenue);
}
```
## With Subtitle
```razor
@code {
private List salesData = new()
{
new("Jan", 4500), new("Feb", 5200), new("Mar", 4800),
new("Apr", 6100), new("May", 5500), new("Jun", 6700)
};
record SalesData(string Month, decimal Revenue);
}
```
## Custom Sizing
```razor
@code {
private List salesData = new()
{
new("Jan", 4500), new("Feb", 5200), new("Mar", 4800),
new("Apr", 6100), new("May", 5500), new("Jun", 6700)
};
record SalesData(string Month, decimal Revenue);
}
```
## API Reference
| Property | Type | Default | Description |
|----------|------|---------|-------------|
| `TItem` | Generic type | — | The data item type |
| `Data` | `IEnumerable?` | `null` | Data collection to visualize |
| `Name` | `string` | `"Data"` | Series name shown in tooltip |
| `XValue` | `Func?` | `null` | Function to extract X-axis category |
| `YValue` | `Func?` | `null` | Function to extract numeric value |
| `Theme` | `ChartTheme` | `Default` | Color theme (Default, Colorful, Monochrome) |
| `Title` | `string?` | `null` | Chart title |
| `Subtitle` | `string?` | `null` | Chart subtitle |
| `Height` | `string?` | `"400px"` | Chart height |
| `Width` | `string?` | `"100%"` | Chart width |
| `Class` | `string?` | `null` | Additional CSS classes |