# Reference line

Reference lines are used in charts as a benchmark against which to compare data points. This helps viewers quickly assess whether values are above or below a certain target, goal, or historical average. They also help identify trends and aid in making comparisons between different segments.

You can add reference lines for the average, minimum, maximum, standard deviation, etc of a measure or the variance.&#x20;

#### 1.Position

The reference line can be horizontal or vertical. Click the images to see the different positions available for reference lines.

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FRtZRhbQzDp2k4Lznwaxz%2Fimage.png?alt=media&#x26;token=72692965-928c-4eb4-9a76-6f78f1d75eb3" alt=""><figcaption><p>Horizontal reference line</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F1gNfkNIEjokEg6GlRlC3%2F2024-05-01_20h36_19.png?alt=media&#x26;token=d85dca59-f127-4d24-bb51-c7343f05ba6b" alt=""><figcaption><p>Vertical reference line</p></figcaption></figure></div>

You can choose the position of the reference line on the x-axis when the vertical option is selected. In the example, the reference line is rendered at the fourth position.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FVr1nI19sOrjrNnbfhfFE%2Fimage.png?alt=media&#x26;token=1e489f4f-c471-4b18-bf3b-3d29ba3e4506" alt=""><figcaption><p>Vertical reference line position</p></figcaption></figure>

#### 2. Display

You can use measures or the absolute or relative variance to plot reference lines. Select the source from the dropdown.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FfkpVbFp2d33rmFkkHf0C%2Fimage.png?alt=media&#x26;token=a19aa258-810d-40db-82a5-782c42049b51" alt=""><figcaption><p>Source for reference lines</p></figcaption></figure>

#### 3. Based on

Select the aggregation method to be used to plot the reference line. You can also plot a reference line based on a custom input value. Click on the images to view reference lines plotted using maximum, minimum, median, and standard deviation.&#x20;

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2Feg4pUuB1yIS4JUApDl1V%2Fimage.png?alt=media&#x26;token=1bf4d585-4982-4690-82b4-d7bfd28cf165" alt=""><figcaption><p>Reference line based on median</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FfSU5mYZu2jEgiXtcJhg5%2F2024-05-01_20h44_56.png?alt=media&#x26;token=5dcdd16d-a69d-45e9-8ec2-32975699d154" alt=""><figcaption><p>Reference line based on minimum</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FxtAqzWp1QSu9a7rO05ZQ%2F2024-05-01_20h46_35.png?alt=media&#x26;token=74ec1d04-3a7f-4a52-bbb4-66a45d09d954" alt=""><figcaption><p>Reference line based on maximum</p></figcaption></figure></div>

{% hint style="info" %}
When you choose standard deviation as the aggregation type, you can specify the Standard Factor in the textbox. Values between 0 and 10 are the accepted range.&#x20;
{% endhint %}

Leverage the "Field" option in analytics to use storytelling tools like data-driven reference lines. Plot reference lines using input measures to visualize data over time, detect trends, and identify potential concerns. To plot data-driven reference lines, choose "Field" from the Based on dropdown and select the measure from the **Value** dropdown.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F9OB5EDwulureUmpeMZRr%2Fimage.png?alt=media&#x26;token=499bd561-b0ac-497a-8816-4711d67601f8" alt=""><figcaption><p>Data driven reference line</p></figcaption></figure>

#### 4. Line

Set the style (solid, dotted, dashed), thickness, and color of the reference line.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FENowfE6jMMrdq9VvNKXw%2Fimage.png?alt=media&#x26;token=be1d99a2-33b6-48aa-aadb-cd9b9d844e26" alt=""><figcaption><p>Reference line style</p></figcaption></figure>

#### 5. Placement

The reference line can be rendered in front of the chart or behind the chart using this option. In the example, we've plotted the reference line behind the chart.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F0qTNQ0Mr5A62LJ97dmT6%2Fimage.png?alt=media&#x26;token=f93a1203-1e39-4d82-990e-4ad4b916eb9c" alt=""><figcaption><p>Placement</p></figcaption></figure>

#### 6. Label

Enable the label toggle to display the data values for reference lines.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FfQxXLuooi6Ms6GDyM4PY%2Fimage.png?alt=media&#x26;token=aa2c9fe5-8061-44bb-898c-0bf23333a2ad" alt=""><figcaption><p>Label toggle</p></figcaption></figure>

* **Type**

Analytics+ displays the aggregation type and the value used to plot the reference line. You can choose from the options listed below:

* Text: displays the aggregation type only
* Value: displays the calculated value only
* Text + Value: displays the aggregation type as well as the calculated value

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FjMv7lXCPUAGM8TwnGoQX%2Fimage.png?alt=media&#x26;token=dd89141d-f5f4-4a68-b8a1-c9b371858bcb" alt=""><figcaption><p>Reference line label</p></figcaption></figure>

* **Name**: You can set a custom name for the reference line. By default, the selected aggregation type will be displayed. In the example, we've set the name of the reference line to "Avg of AC".

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2Fhb43KknnQXfkHAnPrVRU%2Fimage.png?alt=media&#x26;token=29ade8db-4a58-4e20-9871-e00b788badeb" alt=""><figcaption><p>Reference line name</p></figcaption></figure>

* **Format:** You can set the label font size, style, and color. You can choose from Regular, Semi bold, and Bold font styles.&#x20;

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FD8szSKijpJ1SoYj8aSqP%2Fimage.png?alt=media&#x26;token=0324d788-7de0-41b4-88f7-29d2538d2eb7" alt=""><figcaption><p>Label style</p></figcaption></figure>

* **Background color:** Highlight reference line values by setting a custom background color.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F9XCpJDKicg8ApAxcZ6f7%2Fimage.png?alt=media&#x26;token=99eb2367-2429-4ded-8b57-49455c0df1ce" alt=""><figcaption><p>Label background color</p></figcaption></figure>

* **Vertical:** Set the vertical positioning of the label with respect to the reference line.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FDAdgXMeT9ImMu0ZQoTre%2Fimage.png?alt=media&#x26;token=e20856f7-00be-4cd2-93d1-b59c42264b3b" alt=""><figcaption><p>Vertical positioning</p></figcaption></figure>

* **Horizontal**: Set the horizontal positioning of the label with respect to the reference line.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FKmjQQjNSsLhPXJB3amkf%2Fimage.png?alt=media&#x26;token=93a55d15-240d-44ca-9e84-5071db0738fc" alt=""><figcaption><p>Horizontal</p></figcaption></figure>

* **Offset:** You can position the label anywhere within the canvas by specifying the x and y coordinates.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FgYZWfSy7ylXrvjT2HyBX%2Fimage.png?alt=media&#x26;token=9c976089-c8de-43e7-a629-847c59c2fcbb" alt=""><figcaption></figcaption></figure>

* **Rotation**: The labels can be rotated for enhanced visibility.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F3VCwWh2VWQe0ic3aExXE%2Fimage.png?alt=media&#x26;token=c3669b70-7fe5-47c3-b527-1ba872127773" alt=""><figcaption><p>Label rotation option</p></figcaption></figure>

## Reference lines for time series data

When your dataset contains a time series, you can render reference lines for custom dates or the current date or n-days from the current date. Select the **Timeseries** radio button as the Type option.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2Fp6IqNdh3b9LhkG4JEsjn%2Fimage.png?alt=media&#x26;token=33610a68-4c4a-44a8-9d25-30c72173967b" alt=""><figcaption><p>Setting a reference lines based on a custom date </p></figcaption></figure>

When you choose the *Days upto today* or *Days from today* options, you can specify the number of days.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FjagaOg0It1eZ1zPWZc2Q%2Fimage.png?alt=media&#x26;token=97da6434-bf83-4c1f-953e-bf761405a85b" alt=""><figcaption><p>Reference band rendered for Days upto today </p></figcaption></figure>
