Open Presentation

Search docs

Loading documentation…
    OpenPresentation/opf
    Browse docs
    On this page
    View source

    Metric Gauge

    A metric's gauge (see Metric.gauge): the range its value is drawn against, with optional bands and a target.

    Metadata

    Definition
    #/$defs/MetricGauge
    Form
    object
    Source
    spec/schemas/opf.schema.json

    Field index

    FieldTypeReq.Description
    minref:FiniteNumber—The value at the arc's start (its left end).
    maxref:FiniteNumberyesThe value at the arc's end (its right end). Must be greater than 'min' ('metric-gauge-range' warning otherwise, and no gauge is drawn).
    bandsarray<ref:ChartBand>—Ranges of the gauge shaded along its arc, as a chart's bands: each from the previous 'to' (the first from 'min') to its own 'to'. A band without a color is a neutral; a band with one is a light tint of it, and the value arc takes the band's full color while the value falls in it.
    targetref:FiniteNumber—A value marked by a tick across the arc. A target outside 'min' to 'max' is not drawn ('metric-gauge-range' warning).

    min

    typeref:FiniteNumberrequirednodefault0

    The value at the arc's start (its left end).

    max

    typeref:FiniteNumberrequiredyesdefault—

    The value at the arc's end (its right end). Must be greater than 'min' ('metric-gauge-range' warning otherwise, and no gauge is drawn).

    bands

    typearray<ref:ChartBand>requirednodefault—

    Ranges of the gauge shaded along its arc, as a chart's bands: each from the previous 'to' (the first from 'min') to its own 'to'. A band without a color is a neutral; a band with one is a light tint of it, and the value arc takes the band's full color while the value falls in it.

    bands[].color · Allowed values
    "accent1""accent2""accent3""accent4""accent5""accent6""dark1""dark2""light1""light2""primary""secondary""accent""background""surface""surfaceAlt""text""textSecondary"

    target

    typeref:FiniteNumberrequirednodefault—

    A value marked by a tick across the arc. A target outside 'min' to 'max' is not drawn ('metric-gauge-range' warning).

    Complete definition constraints
    Schema constraints
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "max"
      ],
      "description": "A metric's gauge (see Metric.gauge): the range its value is drawn against, with optional bands and a target.",
      "properties": {
        "min": {
          "$ref": "#/$defs/FiniteNumber",
          "default": 0,
          "description": "The value at the arc's start (its left end)."
        },
        "max": {
          "$ref": "#/$defs/FiniteNumber",
          "description": "The value at the arc's end (its right end). Must be greater than 'min' ('metric-gauge-range' warning otherwise, and no gauge is drawn)."
        },
        "bands": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ChartBand"
          },
          "minItems": 1,
          "maxItems": 6,
          "description": "Ranges of the gauge shaded along its arc, as a chart's bands: each from the previous 'to' (the first from 'min') to its own 'to'. A band without a color is a neutral; a band with one is a light tint of it, and the value arc takes the band's full color while the value falls in it."
        },
        "target": {
          "$ref": "#/$defs/FiniteNumber",
          "description": "A value marked by a tick across the arc. A target outside 'min' to 'max' is not drawn ('metric-gauge-range' warning)."
        }
      },
      "examples": [
        {
          "max": 1
        },
        {
          "min": -100,
          "max": 100,
          "bands": [
            {
              "to": 0,
              "label": "Detractors lead",
              "color": "accent2"
            },
            {
              "to": 30
            },
            {
              "to": 100,
              "label": "Strong",
              "color": "accent3"
            }
          ],
          "target": 40
        }
      ]
    }