# Sparkline with limits

> The sparkline with limits screen object: the last minutes of a tag with its limit lines, the normal band and the current value, filled from the historian whe...

Product: eaxScada · Type: Reference · Editions: Starter
Source: https://eaxware.com/docs/eaxscada/reference/generated/widgets/gauges/sparkline-with-limits/
Verified against commit 4064fb4.

<!-- GENERATED by tools/docgen (node tools/docgen/docgen.mjs). Do not edit by hand: change the source and regenerate. -->

A small trend of one tag over the last minutes (15 by default), with dashed lines at its limits (LL, L, H, HH, labelled), the normal band shaded grey and the current value at the top right. When the screen opens, the time window is filled from the historian, then live samples are added.

The line is grey while the value is normal. When the current value is beyond a limit, that limit's line and the readout take its colour: amber for L or H, red for LL or HH. Bad and Uncertain samples are drawn apart from good ones, never as good; a Bad current value hatches the plot and strikes through the readout, and the quality marker names the tag, its quality and its age. Before the first sample the plot says *No samples yet*.

Like every trend it has a time zoom (wheel, pinch and a slider under the plot), a tooltip with values and quality, and PNG and CSV export buttons. Display only: it writes nothing. See [High-performance displays](/docs/eaxscada/explanation/high-performance-displays/).
[Image: A sparkline with limits: Air header pressure over 15 minutes, the grey normal band between dashed L and H lines, 6.85 bar at the top right.]
|  |  |
|---|---|
| Palette | Not in the palette |
| JSON `type` | `LimitSparkline` |
| Name in the inspector | Sparkline with limits |
| Size | drawn from `width` and `height`; a resize changes them |
| Added by | `designer_sa_widgets.js` |

## Properties

| Shown as | Key | Type | Unit | Default | Allowed values | What it does |
|---|---|---|---|---|---|---|
| Name | `label` | Text |  | `"Sparkline"` |  | The name drawn at the top left of the object (and shown in the layers list and on a phone row). |
| Value tag | `pvTag` | Tag path (read) |  | — |  | The tag drawn, with its quality. |
| Time window (minutes) | `historyMinutes` | Number | min | `15` | min 1, max 1440, step 1 | The time window shown, 1 to 1440 minutes, loaded from the historian when the screen opens. Default 15. |
| Scale minimum | `min` | Number |  | — |  | Bottom of the value axis. Empty (with the maximum empty too): the axis follows the data. *Inspector hint: Empty = 0* |
| Scale maximum | `max` | Number |  | — |  | Top of the value axis. Empty (with the minimum empty too): the axis follows the data. *Inspector hint: Empty = 100* |
| Decimals shown | `decimals` | Number |  | — | min 0, max 6, step 1 | Decimals of the readout and the tooltip, 0 to 6. Empty: chosen from the scale. |
| Unit | `unit` | Text |  | — |  | Engineering unit shown after the value (%, bar, degC). Display only: it does not convert anything. |
| Alarm limits | `limitsSource` | Choice |  | `"alarms"` | `alarms`<br>`manual`<br>`none` | Where the limit lines come from. alarms (default): the value tag's alarm definitions (LOW_LOW, LOW, HIGH, HIGH_HIGH); a limit the tag has no alarm for is taken from the hand-set limit of the same kind. manual: the four hand-set limits. none: no lines. |
| Low-low limit (LL) | `limitLL` | Number |  | — |  | Hand-set low-low limit (manual), or the fallback when the tag has no LOW_LOW alarm (alarms). |
| Low limit (L) | `limitL` | Number |  | — |  | Hand-set low limit (manual), or the fallback when the tag has no LOW alarm (alarms). |
| High limit (H) | `limitH` | Number |  | — |  | Hand-set high limit (manual), or the fallback when the tag has no HIGH alarm (alarms). |
| High-high limit (HH) | `limitHH` | Number |  | — |  | Hand-set high-high limit (manual), or the fallback when the tag has no HIGH_HIGH alarm (alarms). |
| Normal band from | `normalLow` | Number |  | — |  | Start of the shaded normal band. Empty: the low limit (L), else LL. *Inspector hint: Empty: the low limit (L).* |
| Normal band to | `normalHigh` | Number |  | — |  | End of the shaded normal band. Empty: the high limit (H), else HH. *Inspector hint: Empty: the high limit (H).* |
| PNG and CSV export buttons | `exportButtons` | Yes / no |  | `true` |  | Shows the PNG and CSV export buttons over the plot's top right corner. Default on. |
| — | `width` | Number |  | `300` |  | Width of the object. Default 300. A plot under about 110 px high drops the zoom slider (wheel and pinch still zoom). |
| — | `height` | Number |  | `130` |  | Height of the object. Default 130. |
| X | `x` | Number | px | — |  | Horizontal position of the object's top-left corner on the screen, in screen pixels from the left edge. |
| Y | `y` | Number | px | — |  | Vertical position of the object's top-left corner, in screen pixels from the top edge. |
| Rotation | `rotation` | Number | ° | — |  | Rotation of the object, clockwise, in degrees. |
| Opacity | `opacity` | Number |  | — |  | 0 (invisible) to 1 (opaque). An object disabled by an interlock is drawn at 0.45 whatever this says. |
| States | `states` | Object |  | — |  | This object's own state styles (normal, hover, pressed, on, disabled, bad, locked, unconfigured), edited in the inspector's States section. Visual only. Empty: the project's state styles. |
| State family | `styleFamily` | Text |  | — |  | The state family whose project styles apply (button, input, toggle, selector, faceplateButton, default). Empty: the family of the object's type. |

## Bindings and conditions

The object reads this tag through its own properties, with their quality: `pvTag`. A Bad or Uncertain value is marked on the object (see Quality below), never drawn as good.

The **Bind** tab ties a property to a tag or an expression: a *tag* binding takes the tag's value, an *expression* binding computes one (see the [expression language](/docs/eaxscada/reference/expression-language/)), optionally through a map, format or script transform. The targets the Bind tab offers for this object:

| Bind tab target | Key | What the bound value does |
|---|---|---|
| Fill Color | `fill` | Sets the fill colour from the value (a colour text such as #22c55e, or a colour mapped by a map transform). |
| Stroke / Border Color | `stroke` | Sets the outline colour from the value. |
| Opacity (0.0 - 1.0) | `opacity` | Sets the opacity from the value (0 to 1). |
| Visibility (Boolean) | `visible` | Shows the object when the value is true or non-zero, hides it otherwise. |
| Rotation (°) | `rotation` | Rotates the object by the value, in degrees. |
| Scale / Pulse | `scale` | Scales the object by the value (1 = drawn size). |
| Text / Label | `text` | Replaces the text drawn with the value, formatted by the binding's format. On a Text object a number is followed by the object's unit, as with the Value target (never a word). A Bad value shows a dash. |
| Value (Numeric) | `value` | Shows the value as the object's readout (with the unit and decimals). A Bad value shows a dash. |

The **Cond** tab adds rules evaluated on every value change: **Visibility** (show or hide, by condition or role), **Color & Fill** (colour bands, alarm blinking), **Position** and **Size & Fill** (motion and level mapped from a value), **Rotation** (angle or continuous spin; an empty input range is 0 to 100 and empty angles are -135° to 135°, while 0 is a value), **Security & Touch** (the interlock: a *disable condition*, the role required, what happens when the interlock reads a Bad value) and **Text & Value** (formatted text). A condition that reads a Bad value is never applied as if the value were good: visibility shows the object marked Bad, colours go neutral grey, motion stays where it is, text shows a dash.

## Actions

Any object can carry a click or tap action (the **Action** tab, or **Full Dialog...**). A write action whose tag, value or target is missing is *not configured*: the inspector says so and the operator's press does nothing (unconfigured means disabled). Navigation actions write nothing and ask no confirmation. On touch screens only a deliberate tap runs an action: a swipe or a pinch that ends on the object never does. Action types:

| Action | Key (`action.type`) | What it does |
|---|---|---|
| Set tag to 1 | `set_1` | Writes 1 to the action's tag. |
| Set tag to 0 | `set_0` | Writes 0 to the action's tag. |
| Toggle tag value | `toggle` | Writes the opposite of the tag's LIVE value: 0 when it is not 0, 1 when it is 0. When the live value is unknown, not Good or not a number, nothing is written and the operator is told why; when it changes while the operator confirms or signs, nothing is written either. |
| Set tag to 1 on press and to 0 on release | `momentary_1_0` | Writes 1 while pressed and 0 on release (hold to run). On touch, the press counts only after the finger is held still; the release is always sent. A held press is also released when the browser window loses focus or the page is hidden, and in the designer when a drag or a resize of the object starts. |
| Set tag to 0 on press and to 1 on release | `momentary_0_1` | Writes 0 while pressed and 1 on release. Released in the same cases as the 1/0 momentary. |
| Write custom value | `write_val` | Writes the number in write_value. |
| Run script | `run_command` | Runs a client script with the scripting API (system.tag.write, system.nav.openPopup...). Ctrl+Space completes the API. |
| Navigate to page / screen | `navigate` | Opens another screen, optionally with parameters or a parameter set. |
| Open popup screen | `open_popup` | Opens a screen in a popup window: modal or not, centred, next to the object or at a fixed position, with parameters. |
| Close popup | `close_popup` | Closes the popup the object is in, or the popup with the given id. |
| Open dock | `open_dock` | Opens a screen docked to an edge of the runtime (top, bottom, left, right). |
| Close dock | `close_dock` | Closes the dock on that edge. |
| Open or close dock | `toggle_dock` | Opens or closes the dock on that edge. |
| Back | `nav_back` | Goes back to the previous screen. |
| Forward | `nav_forward` | Goes forward again after Back. |
| Home screen | `nav_home` | Opens the project's home screen. |
| Open downtime panel | `open_downtime` | Opens the operator runtime's Downtime panel (OEE and downtime, Pro and Enterprise), optionally on one machine (its machine id). Navigation only: nothing is written to a tag or a machine. A machine the operator may not read is not shown; where the panel is not available, a notice says so. Offered in the designer only when the licence includes OEE and downtime. |

## States, text and parameters

**States.** An object's look follows its state: normal, hover, pressed, on, disabled, bad (quality), locked (role) and unconfigured. The project's state styles (opened from an object's **States** section, or from the Project manager's Operator runtime section) give each family of objects its colours per state, and the inspector's **States** section overrides them for one object (stored in `props.states`). States are visual only: whether an object can be operated is decided by its interlock, the user's rights and the server.

This object belongs to the state family `default` (all other objects): disabled (an interlock dims it to 0.45 opacity), bad (a tag it reads is Bad) and locked (missing role) apply when the object has conditions or an action; the other states apply to objects that are operated.

**Screen parameters.** On a screen with parameters, `{Name}` in any text of the object (tag paths of bindings and actions, expressions, conditions, interlocks, the confirmation tag, texts) is replaced by the parameter's value when the screen opens, so one screen serves many pieces of equipment (`{Pump}/Running`). See [screen parameters](/docs/eaxscada/reference/screen-parameters/).

**Quality.** This high-performance object draws its own quality marker, at the top next to its name, in the colours of every other marker: a red x for a Bad value or no value yet, a blue lock for a tag the signed-in account may not read, an amber ? for Uncertain, a grey marker for stale. The lock shows only when every Bad tag of the object is not readable: a device fault keeps the red x. The object shows one marker, for its worst state, and the marker's tooltip lists the tag, its quality and its age, with Not readable for this account for a refused tag. A value that is not readable is never shown as a number: the readout shows a dash. See [show bad and stale values](/docs/eaxscada/how-to/show-bad-and-stale-values/).

**Comments.** In the studio, right-click the object and choose **Add comment** to start a design-review thread on it; a numbered pin marks objects with open threads (Starter, Pro and Enterprise). Pins are shown in the designer only, never in the runtime. See [review screens before deploy](/docs/eaxscada/how-to/review-before-deploy/).

## Examples

### Active power over the last 15 minutes

The site's active power with its high alarm drawn as a line: the operator sees the trend toward the limit before the alarm comes.

1. Place a **Sparkline with limits** from **Widgets** (Situational awareness); **Name** `Active power, 15 min`.
2. **Value tag** `Plant/Processing/Utilities/Power/Demand`; unit `kW`; **Time window** 15.
3. **Alarm limits**: *From the value tag's alarms* (the tag's HIGH alarm at 470 kW is drawn as the H line).
[Image: Active power over the last 15 minutes]

The last 15 minutes of active power under the dashed H line at 470 kW; the PNG and CSV buttons export what is plotted.
<details>
<summary>The sparkline with limits as saved in the screen (JSON)</summary>

```json
{
  "type": "LimitSparkline",
  "props": {
    "label": "Active power, 15 min",
    "pvTag": "Plant/Processing/Utilities/Power/Demand",
    "historyMinutes": 15,
    "unit": "kW",
    "limitsSource": "alarms"
  }
}
```

</details>

## See also

- [High-performance displays](/docs/eaxscada/explanation/high-performance-displays/)
- [Mini-trend tile](/docs/eaxscada/reference/generated/widgets/gauges/mini-trend-tile/)
- [Trend chart](/docs/eaxscada/reference/generated/widgets/data/trend-chart/)
