# Line chart

{% hint style="info" %}
Availability:

* Summary view - All modes except for Transaction mode.
* Focused view (when you select and focus on items in a dimension) - Period and Moving mode only.
  {% endhint %}

A Line chart plots performance over time and allows you to spot trends and make comparisons, for example, a customer's sales for this year vs. last year.

<table data-header-hidden><thead><tr><th width="148"></th><th></th><th></th></tr></thead><tbody><tr><td> </td><td><strong>Summary view</strong></td><td><strong>Focused view</strong></td></tr><tr><td><strong>Contents</strong></td><td>There is a blue line for the current period (or stream) and a red line for the previous period (or other stream).</td><td>There is a line for each of the focused items.</td></tr><tr><td><strong>X-axis</strong></td><td>The X-axis displays the time units of your current period. </td><td></td></tr><tr><td><strong>Y-axis</strong></td><td>The Y-axis displays the total or value of each measure, which starts at zero.</td><td></td></tr><tr><td><strong>Example</strong></td><td><img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/wP4bHPW4GeMbf4Ppw77u/3017867664.png" alt="" data-size="original"></td><td><img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/w9SrzfOc8RSuSvFUjWLt/3017965906.png" alt="" data-size="original"></td></tr></tbody></table>

<details>

<summary>Example 1: Create a Line chart</summary>

In the Sales database, create a Line chart to compare the sales of a particular product this year compared to last year.&#x20;

1. Prepare the data in the grid: In Period mode, select the **Product** dimension, then select and focus on the top ten products (highest sales). Select **Period** > **Rolling 12 months**, then click the **Summary** button to view the total of the selected products across the period.
2. Click the **Chart** button in the top right toolbar above the grid.
3. Click the **Line** chart category button on the left of the chart and select the **Line** option.

   <div align="left"><figure><img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/wfMGc7m7kehcTXuIMUTC/3016691219.png" alt="" width="102"><figcaption></figcaption></figure></div>

   The lines in the chart depict the current and previous values. You can see that the selected products are selling better in almost every month this year (blue) compared to last year (red).&#x20;

   <div align="left"><figure><img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/sUxijCK7BWzRzDN93BrS/3018031347.png" alt="" width="510"><figcaption></figcaption></figure></div>
4. (Optional) Select the **Use cumulative** option to chart current vs. previous cumulative for each time unit, rather than simply current vs. previous.

   <div align="left"><figure><img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/uSguVynGyRRS4FhsKowu/3017736769.png" alt="" width="510"><figcaption></figcaption></figure></div>

</details>

<details>

<summary>Example 2: Create a line chart that displays data for working days only</summary>

If you create a [working day calendar](https://docs.phocassoftware.com/analytics/visualize-your-data-in-a-chart/broken-reference) in Phocas and select a *day* period type in the grid, you can apply a working day calendar to the Line chart.

For example, suppose your business operates from Tuesday to Saturday each week. Sunday and Monday are non-working days.

<img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/E9GVnZtB8eJ83zkHtmw2/3385819174.png" alt="" data-size="original">

When you look at the data over a week, you see troughs on Sundays and Mondays where the values are 0 (expected), as illustrated by the highlighted areas in the image on the left below. You might prefer to show only working days (exclude non-working days) in the chart, to more accurately reflect what’s going on. In the image on the right below, you can see the data trend more clearly when Sundays and Mondays are removed from the chart.

<img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/sUwmwQkZwsJdg3vCjQB6/3384672920.png" alt="" data-size="original">

In the Sales database, create a Line chart to compare the revenue earned in December this year compared to December last year.&#x20;

1. In Period mode, Summary view, select a day type of period from the **Period** menu.
2. Click the **Chart** button in the top right toolbar above the grid.
3. Click the **Line** chart category button on the left of the chart and select the **Line** option.
4. Select **Filter by calendar** and select the required calendar, such as **Working Days**, then click out of the box to apply your change. The chart updates to only display data for the working days.

   <div align="left"><figure><img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/JsBAPcn4KF5npjhrygBf/3385688134.png" alt="image-20240304-002941.png" width="459"><figcaption></figcaption></figure></div>

</details>

***

{% hint style="success" %}
**Related pages**

You can take the following actions with your chart:&#x20;

[Configure the chart options](https://docs.phocassoftware.com/analytics/visualize-your-data-in-a-chart/configure-the-chart-options) | [Select and focus on a chart segment](https://docs.phocassoftware.com/analytics/visualize-your-data-in-a-chart/select-and-focus-on-a-chart-segment) | [Use the chart legend](https://docs.phocassoftware.com/analytics/visualize-your-data-in-a-chart/use-the-chart-legend) | Save the chart as a favorite | Add the chart to a dashboard | [Export a chart as an image](https://docs.phocassoftware.com/analytics/visualize-your-data-in-a-chart/export-a-chart-as-an-image)

See also the main page: [Visualize your data in a chart](https://docs.phocassoftware.com/analytics/visualize-your-data-in-a-chart)
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.phocassoftware.com/analytics/visualize-your-data-in-a-chart/line-chart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
