Skip to main content
Version: 1.0.8

Linear Scale

A ruler-style scale with tick marks, numeric labels, indicators and a live pointer. A linear alternative to a gauge, and much easier to stack in a column of related values.

The Linear Scale component as it renders with its default settings.The Linear Scale component as it renders with its default settings.

Reach for it when you need:

  • Several related values shown side by side at the same scale

Component name: LinearScale · Category: Display

In the palette: Ruler-style scale — tick marks, numeric labels, indicators and a live pointer

Properties​

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

PropertyTypeDefaultDescription
valuenumber50Live value marked by the pointer — bind this to a tag.
minValuenumber0—
maxValuenumber100—
orientationenumverticalLay the scale out along the Y or the X axis. A vertical scale reads minValue at the BOTTOM. Options: vertical · horizontal.
tickSideenumendWhich side of the axis line the tick marks and their numbers sit on. Options: end · start.
reversebooleanfalseInvert the order of the values so the scale runs max → min.
axisobject{"show":true,"color":"var(--widget-scale)","stroke":1}The baseline the ticks hang off.
  ↳ axis.showbooleantrueDraw the baseline the ticks hang off.
  ↳ axis.colorcolorvar(--widget-scale)—
  ↳ axis.strokenumber1—
majorTicksobject{"interval":20,"length":12,"color":"var(--widget-scale)","st… (truncated)The labelled ticks. interval is in VALUE units, so the tick count survives a resize.
  ↳ majorTicks.intervalnumber20Distance between major ticks, in value units.
  ↳ majorTicks.lengthnumber12—
  ↳ majorTicks.colorcolorvar(--widget-scale)—
  ↳ majorTicks.strokenumber1.5—
minorTicksobject{"perMajor":4,"length":7,"color":"var(--widget-scale)","stro… (truncated)Unlabelled ticks subdividing each major interval.
  ↳ minorTicks.perMajornumber4Minor ticks per major interval. 0 or 1 turns them off.
  ↳ minorTicks.lengthnumber7—
  ↳ minorTicks.colorcolorvar(--widget-scale)—
  ↳ minorTicks.strokenumber1—
fineTicksobject{"perMinor":0,"length":4,"color":"var(--widget-scale)","stro… (truncated)The finest tier, subdividing each minor tick.
  ↳ fineTicks.perMinornumber0Fine ticks per minor tick. 0 or 1 turns them off.
  ↳ fineTicks.lengthnumber4—
  ↳ fineTicks.colorcolorvar(--widget-scale)—
  ↳ fineTicks.strokenumber0.75—
labelsobject{"show":true,"decimals":0,"unit":"","angle":0,"color":"var(-… (truncated)The numbers printed under the major ticks.
  ↳ labels.showbooleantrueShow the number under each major tick.
  ↳ labels.decimalsnumber0—
  ↳ labels.unitstring""Appended to each number — tight for symbols (%, °), spaced otherwise.
  ↳ labels.anglenumber0Rotation of the numbers, in degrees.
  ↳ labels.colorcolorvar(--widget-scale)—
  ↳ labels.sizenumber9—
pointerobject{"show":true,"style":"wedge","placement":"outside","length":… (truncated)The marker that tracks the live value.
  ↳ pointer.showbooleantrueDraw a marker at value.
  ↳ pointer.styleenumwedgeOptions: wedge · line.
  ↳ pointer.placementenumoutsideInside puts the pointer on the same side as the tick marks; outside puts it on the opposite side. Options: outside · inside.
  ↳ pointer.lengthnumber14—
  ↳ pointer.colorcolorhsl(43 96% 56%)—
  ↳ pointer.strokenumber2—
  ↳ pointer.showLabelbooleantruePrint the numeric value at the pointer.
  ↳ pointer.labelColorcolorvar(--widget-value)—
  ↳ pointer.labelSizenumber10—
  ↳ pointer.labelDirectionenumautoAuto turns the readout 90° on a vertical scale, keeping its lane narrow, and leaves it flat on a horizontal one. Options: auto · horizontal · vertical.
titleobject{"show":true,"text":"Linear Scale","color":"var(--widget-lab… (truncated)Caption in the strip below the scale.
  ↳ title.showbooleantrue—
  ↳ title.textstringLinear Scale—
  ↳ title.colorcolorvar(--widget-label)—
  ↳ title.sizenumber11—
indicatorsarray[]Fixed marks on the scale. Each item: { value, label, indicatorStyle: 'wedge'|'line'|'range', placement: 'inside'|'outside' (inside = overlaid on the tick marks, outside = the opposite side; for a range band this moves the LABEL only, the band always stays on the scale), length, extent (range style only, in value units), stroke (line style only), color, opacity, labelColor, labelSize, labelDirection: 'auto'|'horizontal'|'vertical', labelAngle }.
  ↳ indicators.valuenumber50—
  ↳ indicators.labelstring""—
  ↳ indicators.indicatorStyleenumwedgeOptions: wedge · line · range.
  ↳ indicators.placementenumoutsideWhere this indicator sits relative to the tick marks. For a range band this moves the LABEL only — the band itself always stays on the scale. Options: outside · inside.
  ↳ indicators.lengthnumber14—
  ↳ indicators.extentnumber10—
  ↳ indicators.strokenumber2—
  ↳ indicators.colorcolor#3b82f6—
  ↳ indicators.opacitynumber1—
  ↳ indicators.labelColorcolorvar(--widget-label)—
  ↳ indicators.labelSizenumber9—
  ↳ indicators.labelDirectionenumautoAuto turns the label 90° on a vertical scale so its lane stays narrow, and leaves it flat on a horizontal one. Options: auto · horizontal · vertical.
  ↳ indicators.labelAnglenumber0—
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.