Skip to main content
Version: 1.0.8

HMI Sparkline

A small inline trend with an optional desired-range band, light enough to repeat many times on one view — one beside every value in a table of forty tags.

The HMI Sparkline component as it renders with its default settings.The HMI Sparkline component as it renders with its default settings.

Reach for it when you need:

  • A trend beside each row of an equipment list
  • Recent context next to a numeric readout, where a full chart would not fit

Component name: HmiSparkline · Category: Chart

In the palette: Lightweight inline trend with an optional desired-range band; light enough to repeat many times per view

Properties​

Any property can be bound to a tag, another component's property, or a query.

PropertyTypeDefaultDescription
tagPathtag""Historized tag to trend — pick from the selector (history-enabled tags only). When set, the sparkline pulls the trailing window of that tag's history (blank until it resolves); leave empty to use the bound data instead.
windowenum300Trailing time window of history to draw (only used when tagPath is set). Options: 60 · 300 · 900 · 3600 · 21600 · 86400.
dataany—Fallback series values when no tagPath is bound — bind to a named query, or leave blank for the sample trend. Auto-decimated (min/max) to the widget width.
showWindowLabelbooleantrueShow the trailing-window label (e.g. "5 min") in the corner. Tag-history mode only.
windowLabelColorcolorvar(--widget-label)—
windowLabelSizenumber12—
desiredLonumber35Bottom of the desired-range back-band (blank = no band).
desiredHinumber65—
yMinnumber""Fixed Y minimum (blank = auto-range).
yMaxnumber""Fixed Y maximum (blank = auto-range).
lineColorcolor#64748b—
lineWidthnumber1.5—
bandColorcolor#b8daffDesired-range back-band colour — a solid pale blue, SHARED with the MAI desired band (green is reserved — it conditions "all clear").
showDotbooleantrue—
dotColorcolorvar(--widget-value)—
alarmColorcolor#f57c00Dot colour when the last value leaves the desired band.
stylestyle{}Custom CSS properties

Events​

Attach event actions to these in the Event Manager.

EventLabelGroupPayload
clickClickMouseThe DOM event.
dblclickDouble clickMouseThe DOM event.
contextmenuRight clickMouseThe DOM event.
mouseenterMouse enterMouseThe DOM event.
mouseleaveMouse leaveMouseThe DOM event.
Right-click behaves differently in the Designer

contextmenu fires your configured actions at runtime only — in LiveView and in preview. On the Designer canvas the right-click is captured to open the Event Manager, so testing it there will not run your actions. Test right-click in preview.

Notes​

Choose this over Sparkline when you need many instances on one screen; choose Sparkline when you need its bar or area variants on a handful.

What the trace draws. Changed in 1.0.8 Like the HMI Trend, the sparkline is placed on real time, fetched as M4 at one slot per pixel column (a one-sample spike survives), holds booleans flat, and draws strokes at the samples' own times. Stretches that were not Good are shaded, at least one pixel wide, so a brief fault on a long window still shows. Bad readings are left out of the live tail. Sparklines mounted together share one historian request (up to 32 tags), which is what keeps forty of them on one screen cheap.

See also​