# Line Charts

Line charts are perfect for displaying trends over time by connecting data points with a continuous line. They make it easy to visualize changes and patterns in your data across intervals.

## When to use Line Charts

Line charts work best when you want to:

* Track changes over time (sales trends, growth metrics, etc.)
* Compare multiple trends on the same timeline
* Show continuous data progression
* Identify patterns and anomalies in time-series data

## Configuring Your Line Chart

### Setting the X-Axis

The X-Axis typically represents your time dimension or categorical sequence. Choose a field that shows progression:

**Best practices for X-Axis:**

* **Date/Time fields**: Created Date, Purchase Date, Completed On, etc. (then choose grouping: Year, Quarter, Month, Week, or Day)
* **Sequential categories**: Quarter, Period, Phase
* **Ordered values**: Day of Week (Monday-Sunday), Age Groups

{% hint style="info" %}
**Using date fields:** Select an actual date field (like "Created Date" or "Purchase Date"), then choose how to group the dates: **Year**, **Quarter**, **Month**, **Week**, or **Day**. Noloco automatically sorts dates chronologically (oldest to newest, left to right). You don't need a separate "Month" or "Year" field in your data.
{% endhint %}

**Example:** For tracking monthly sales, set your X-Axis to "Purchase Date" and group by "Month".

### Adding Series (Y-Axis Values)

Series represent the values you want to measure and compare. You can add multiple series to show different metrics on the same chart.

**For each series, you'll configure:**

1. **Y-Axis Value**: The numeric field to display (e.g., Revenue, Count, Total)
2. **Aggregation Method**: How to calculate the value
   * **Sum**: Total of all values
   * **Count**: Number of records
   * **Average**: Mean value
   * **Min/Max**: Lowest or highest value
3. **Series Label**: A clear name for what this line represents

### Example Configuration

**Scenario**: Track monthly revenue vs. expenses

**X-Axis Configuration:**

* Field: `Order Date` (or any date field)
* Group by: `Month`

**Series 1:**

* Label: "Revenue"
* Y-Axis Value: `Revenue` field
* Aggregation: `Sum`

**Series 2:**

* Label: "Expenses"
* Y-Axis Value: `Expenses` field
* Aggregation: `Sum`

This creates a line chart with two lines showing how revenue and expenses trend over each month.

## Multiple Series Best Practices

When adding multiple series to a line chart:

* Use clear, descriptive labels for each series
* Limit to 2-4 series to maintain readability
* Ensure all series use the same units or are comparable

## Common Use Cases

### Sales Tracking Over Time

* **X-Axis**: Order Date (grouped by Month or Week)
* **Series**: Total Sales (Sum), Number of Orders (Count)

### User Growth Analysis

* **X-Axis**: Created Date (grouped by Week or Month)
* **Series**: New Users (Count), Active Users (Count), Churned Users (Count)

### Performance Metrics

* **X-Axis**: Timestamp (grouped by Day)
* **Series**: Response Time (Average), Error Rate (Count)

## Tips for Better Line Charts

1. **Choose appropriate time intervals**: Match your X-Axis grouping to your data density (daily for recent data, monthly for yearly trends)
2. **Start Y-Axis at zero**: Unless showing small variations, starting at zero provides better context
3. **Use filters**: Add view filters to focus on specific time ranges or categories
4. **Add context**: Always include a clear chart title and subtitle explaining what the data shows
