# Line Chart
> Smooth line charts for showing trends over time
Source: https://shellui.dev/docs/v0.4/components/advanced/charts/line-chart
The `LineChart` component renders smooth line charts ideal for showing trends, progress, and changes over time. Built on **ApexCharts.Blazor** with `Curve.Smooth` and rounded line caps.
## Installation
```bash
shellui add chart line-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 trafficData = new()
{
new("Mon", 1200), new("Tue", 1900),
new("Wed", 1500), new("Thu", 2100),
new("Fri", 1800), new("Sat", 900),
new("Sun", 750)
};
record TrafficData(string Date, int Visitors);
}
```
## Performance Metrics
```razor
@code {
private List perfData = new()
{
new("Mon", 120), new("Tue", 95), new("Wed", 180),
new("Thu", 110), new("Fri", 88), new("Sat", 65), new("Sun", 72)
};
record PerformanceData(string Day, int ResponseMs);
}
```
## Stock Price Trend
```razor
@code {
private List stockData = new()
{
new("Week 1", 142.50m), new("Week 2", 148.20m),
new("Week 3", 145.80m), new("Week 4", 155.30m),
new("Week 5", 152.10m), new("Week 6", 161.40m)
};
record StockPrice(string Date, decimal Price);
}
```
## Multiple Lines
For multiple lines, use [Multi-Series Chart](https://shellui.dev/docs/v0.4/components/advanced/charts/multi-series-chart.md) with `SeriesType.Line`.
## 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 value |
| `YValue` | `Func?` | `null` | Function to extract Y-axis 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 |