gauge properties

Note: STABLE.
This API is reliable and breaking changes are unlikely.

gauge()

These are the properties used by Qlik Sense gauges.

Version history

Introduced 2.2

Properties

showTitles

Type: Boolean

Show title for the visualization.

Default: true.

showDetails

Type: Boolean

Sets if visualization details should be shown.

Default: false

title

Type: String | Expression

Visualization title shown if "showTitles": true.

subtitle

Type: String | Expression

Visualization subtitle shown if "showTitles": true.

footnote

Type: String | Expression

Visualization footnote shown if "showTitles": true.

qHyperCubeDef

Type: Object

The hypercube definition used by most visualizations.

A subset of the properties available in the qHyperCubeDef is presented here. For complete documentation of all available properties, see Engine API: HyperCubeDef.

Properties

Name Type Description
qMeasures Array

Extends NxMeasure, see Engine API: NxMeasure.

Additional properties

Name Type Description
qDef Object

Extends NxInlineMeasureDef, see Engine API: NxInlineMeasureDef.

Additional properties

Name Type Description
autoSort Boolean

Set to automatically sort the measure.

Default: true

cID String ID used by the client. Must be unique within the current chart.
numFormatFromTemplate Boolean

When enabled, the number format to use can be selected from multiple predefined formats based on the desired type: number or date.

Default: true

isCustomFormatted Boolean Set to true to toggle off the default client formatting.
qAttributeExpressions Array

Extends NxAttrExprDef, see Engine API: NxAttrExprDef.

Properties

Name Type Description
id String

One of:

  • colorByAlternative: colors the chart using different dimensions. Can be used together with color.mode="byDimension" for attribute dimensions.
  • colorByExpression: used together with color.mode="byExpression".
qLayoutExclude Object

 

customErrorMessage Object

Set to define custom error messages.

Name Type Description
calcCond String

Deprecated. Use qCalcCondition.qMsg instead.

Set to customize the calculation condition unfilled message.

refLine

Type: Object

Reference line settings.

Properties

Name Type Description
refLines Array

Properties

Name Type Description
show Boolean

Set to true to display this reference line.

Default: true

label String Reference line label.
color Integer

Deprecated. Use paletteColor instead.

Color.

Default: 3

paletteColor Object

Color information structure. Holds the actual color and index in palette.

Properties

Name Type Description
index Integer

Index in the palette. If a custom color, not in the palette, is being used, set index ti -1.

Default: 6

color String

Color as HEX string.

Mandatory if "index": "-1".

measureAxis

Type: Object

Measure axis settings.

Properties

Name Type Description
min ValueExpressionContainer
max ValueExpressionContainer
show String

Set to display the labels and titles. Can be one of:

  • all
  • labels
  • title
  • none

Default: all

spacing Number

Set the axis scale:

Default: 1

gaugetype

Type: String

Sets the visual representation of the gauge. Can be one of:

  • radial
  • bar

Default: radial

autoOrientation

Type: Boolean

Sets auto orientation.

Default: true

orientation

Type: String

Orientation settings. Applicable if "autoOrientation": false. Can be:

  • horizontal
  • vertical

Default: horizontal

angle

Type: Number

Sets the arc size of a radial gauge. All gauges created with Qlik Sense by default sets "angle": 0.7 which means that 70 per cent of the arc is displayed. If you set "angle": 0.5, half of the arc is displayed.

Default: 0.7

useSegments

Type: Boolean

Set to use color segments.

progressColor

Type: Integer

Deprecated. Use paletteProgressColor instead.

Set single color to use. Only used if useSegments is false.

Default: 3

paletteProgressColor

Type: Object

Color information structure. Holds actual color and index in palette.

Name Type Description
index Integer

Index in palette.

Default: 6

color String Color as HEX string.

valueMode

Type: String

Defines if the gauge should display absolute values or relative values. Can be one of:

  • absolute
  • relative

Default: absolute

maxSegments

Type: Integer

Sets the maximum number of color segments.

Default: 6

segmentInfo

Type: Object

Defines segment information. Applicable if "useSegments": true.

Properties

Name Type Description
limits Array

Properties

Name Type Description
value ValueExpressionContainer
gradient Boolean Set to use gradient between segments.
colors Array

Properties

Name Type Description
color Integer

Color of segment.

Default: 3

paletteColors Object

Replaces segment colors and provides ability to set custom colors. Overrides segment.colors when set.

Name Type Description
index Integer

Index in palette.

Default: 6

color String Color as HEX string.

disclaimerClosed

Type: Boolean

Set to true if you do not want to show a disclaimer on gauge objects.

Default: true

color

Type: Object

Controls if colors encoded in master items should be used.

Name Type Description
useBaseColors String

Use colors encoded in master items. One of:

  • off
  • measure

Default: measure

Example using Visualization API

Tip: For more examples of how to create gauges on the fly, see Mashups: Creating gauges.

In this example we create a basic radial gauge, containing one measure, with the titles switched off and a custom range.

app.visualization.create(
  'gauge',
  [
    {
      "qDef": {
        "qLabel": "Fairway hits",
        "qDef": "Avg(FwHit)",
        "qNumFormat": {
            "qType": "F",
            "qnDec": 2,
            "qUseThou": 0,
            "qFmt": "0.0%",
            "qDec": ".",
            "qThou": ","
          }
      }
    }
  ],
  {
    "showTitles": false,
    "measureAxis": {
      "min": 0,
      "max": 1
    },
    "gaugetype": "radial"
  }
).then(function(vis){
  vis.show("QV01");
});

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?