> For the complete documentation index, see [llms.txt](https://help.qtech.co.nz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.qtech.co.nz/datran/datran-vi-scada/datran-trending/pens.md).

# Set up pens

Choose the points a plot shows, and set each pen's style, width, range, colour and draw order.

A pen holds one point from the database which displays the information in a line format on the graph. There are eight pens on a plot. There are 3 different types of pens - analogue, event and alarm. Alarm and event points are digital points. An alarm is a digital point which has two value types - ALM (alarm) and RTN (return to normal). An event is a digital point that has two value types - ON and OFF.

{% hint style="info" %}
**Applies to:** DATRAN Trending V5.x.
{% endhint %}

## Pen states

| State                        | What you see                                                                                                                                                                                                        |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Active and shown             | The Active check box is ticked and the Show check box is ticked. This will show the pen on the graph.                                                                                                               |
| Active and hidden (disabled) | The Active check box is ticked and the Show check box is not ticked. This will not show the pen on the graph and it will be greyed out in the legend. The data is stored in the pen but not displayed on the graph. |
| Inactive                     | The Active check box is not ticked and the entire Pen Properties dialogue is greyed out. The whole legend area for that pen is grey.                                                                                |

## Choose the points for all pens

1. Select **Current Plot > Plot Pens**, or click the change pens button. The **Select Pen Points** window opens.
2. Tick **Active** for each pen you want.
3. Click a pen's point name (or its **...** button) to choose a point. In the **Select Point** window, tick **Filter by station** and the list of point names will automatically filter on the current station selected, which is the first part of the point name. You can search the point names by using the wildcard character asterisk `*`. For example, to show all points with the word 'comm' and followed by 'retries', type `comm*retries`. The match is not case-sensitive.
4. Tick **Show** for the pens to draw.
5. **Selected** allows you to select a point and move it up or down the list of pens. This will change the colour that represents the point because pens at different position in the list have different colours. Use the up and down buttons to move the point.
6. Click **OK**.

![The Select Pen Points window, with seven active pens](https://3621580088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa5hMAUl7E1cWeN5Rghg0%2Fuploads%2FCdGjGbWnc2pFQA3kc1Ls%2Ftrending-select-pen-points.png?alt=media)

The more pens and points you select the longer it will take to retrieve the data for the plot. Use the **Refresh** button if you cannot see a point that has just been created in the DATRAN database after DATRAN Trending was started.

## Change one pen

Right-click the pen's legend panel and select **Properties**.

![The Pen Properties window for an analogue pen](https://3621580088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa5hMAUl7E1cWeN5Rghg0%2Fuploads%2FuEsHOCCaICb9YWMDzniV%2Ftrending-pen-properties.png?alt=media)

| Setting        | What it does                                                                                                                                                                                                                                                                                                                                                                                                       |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Point          | The point the pen shows. Click the name or **...** to change it. The window also shows the point's domain (type), minimum, maximum, units and point ID.                                                                                                                                                                                                                                                            |
| Active, Show   | The pen's state                                                                                                                                                                                                                                                                                                                                                                                                    |
| Width          | The width property of a pen can be changed from 1 to 5 (1 being thin and 5 being thick) depending on what you prefer. Width 1 draws fastest.                                                                                                                                                                                                                                                                       |
| Style          | You can change the style of the pen provided it has an analogue point. Select one of the radio buttons in the style panel: step-line or straight-line.                                                                                                                                                                                                                                                             |
| Interval       | For pens of analogue points, their interval can be changed. A value of 1 means all the points will be included when the plot is exported to a CSV file. 2 means that every other point will be included. 3 means that one in every 3 points will be included and so on. For example, you can get data at intervals of 15 minutes from an analogue point that is logged every minute by setting the interval to 15. |
| Decimal places | Analogue pens can have the number of decimal places displayed in the legend changed.                                                                                                                                                                                                                                                                                                                               |

## The pen menu

Right-click a legend panel for these options. Most are unavailable on a read-only plot.

| Option           | What it does                                                           |
| ---------------- | ---------------------------------------------------------------------- |
| Properties       | Opens Pen Properties                                                   |
| Change Range     | Analogue pens only. See below.                                         |
| Cut, Copy, Paste | Move or copy a pen's point to another pen, in any plot in this session |
| Remove           | Takes the pen off the plot. Its data stays in the database.            |
| Disable          | Hides or shows the pen                                                 |

## Change an analogue pen's range

Analogue pens have a Min to Max range. DATRAN sets this to a default when the point is first set up. On the display of the analogue pen, it scales the actual logged data between the Min and Max values. Any analogue pen can have its current viewable range changed for the current session:

1. Right click on the legend of the pen you want to change and select the **Change Range** menu item.
2. Under **New Range**, enter the **Min** and **Max**: any numbers from -9,999,999 to 99,999,999.
3. Click **Set**. It will redraw the entire pen and ignore any values that lie outside this range.

Click the **Reset** button to set the values back to the DATRAN defaults. Tick the **Auto scale** check box if you would like DATRAN Trending to automatically determine the best range for you. This new range will only be shown for the current session of this plot. Once the plot is closed or the application is closed, these range settings will be lost and the DATRAN default values are displayed. To permanently change the Min and Max values you will need to use DATRAN Browser.

## Show a pen's Y axis

Click a pen's legend panel to show its Y axis. For a digital pen, two lines show its ON (or ALM) and OFF (or RTN) levels. Click the panel again to hide it, and click the axis to move it between the left and right of the graph.

## Draw order

Pens at the top of the list cover the pens at the bottom of the list. To change the draw order, select **Current Plot > Edit Draw Order**. **Up** makes a pen more visible by making it being drawn later than (on top of) the other pens. **Down** makes a pen less visible. **OK** saves the draw order into the DATRAN database.

## Colours and default pen settings

* **Options > Pen Colours** sets the colours of every pen's legend, line and text. **Colour Whole Legend Area** fills the whole legend panel instead of two coloured bars. **Default** restores the factory colours. Changes show when you next open a plot.
* **Options > General Settings > Default Pen Settings** sets the style, width and decimal places for new analogue pens. See [Read and navigate a trend](https://help.qtech.co.nz/datran/datran-vi-scada/datran-trending/navigate.md#general-settings).
