histogram properties

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

histogram()

These are the properties used by Qlik Sense histograms.

Version history

Introduced Qlik Sense June 2017

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
qDimensions Array

Extends NxDimension, see Engine API: NxDimension.

Additional properties

Name Type Description
qDef Object

Extends NxInlineDimensionDef, see Engine API: NxInlineDimensionDef.

Additional properties

Name Type Description
autoSort Boolean

Set to automatically sort the dimension.

Default: true

cID String ID used by the client. Must be unique within the current chart.
othersLabel StringExpressionContainer
qAttributeDimensions Array

Extends NxAttrDimDef, see Engine API: NxAttrDimDef.

Additional 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 Array

Set to define custom error messages.

Name Type Description
calcCond String

Deprecated. Use qCalcCondition.qMsg instead.

Set to customize the calculation condition unfilled message.

dimensionAxis

Type: Object

Dimension axis settings.

Properties

Name Type Description
show String

Labels and title. Can be:

  • all
  • labels
  • title
  • none

Default: all

label String

Sets the label orientation. Can be:

  • auto
  • horizontal
  • tilted

Default: auto

dock String

Axis docking position. Can be:

  • near
  • far

Default: near

measureAxis

Type: Object

Measure axis settings.

Properties

Name Type Description
showBounds Boolean

Set to show min and max on axis.

dock String

Axis docking position. Can be:

  • near
  • far

Default: near

spacing Number

Axis scale.

Default: 1

autoMinMax Boolean

Set to enable automatic max/min.

Default: true

minMax String

Set custom max/min.

One of:

  • min
  • max
  • minMax

Default: min

label StringExpressionContainer
min ValueExpressionContainer
max ValueExpressionContainer

gridlines

Type: Object

Grid line settings.

Properties

Name Type Description
auto Boolean

Set to use automatic grid line spacing.

Default: true

spacing Integer

Set grid line spacing. Only used when auto is set to false. Can be:

  • 0: no lines
  • 1: wide
  • 2: medium
  • 3: narrow

Default: 2

color

Type: Object

Color settings for the distribution plot.

Name Type Description
barColor Object

Bar color properties

Name Type Description
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 to -1.

Default: 6

color String

Color as HEX string.

Mandatory if "index": "-1".

bins

Type: Object

Defines how the bins are visualized.

Properties

Name Type Description
auto Boolean

When set to true, a histogram with no special parameters is generated. When set to false, bins are defined with the binMode property.

Default: true

binMode String

Sets the display mode of the bars when "auto": false. Can be:

  • maxCount: lets you adjust the maximum number of bars to be displayed.
  • size: lets you adjust size of bars and offset from x-axis

Default: maxCount

binCount Integer

Sets number of bars to be displayed. Applicable when "binMode": "maxCount".

Default: 10

countDistinct Boolean Shows unique values.
binSize Integer

Sets the maximum number of bars as a float. Applicable when "binMode": "size".

Default: 10

offset Integer Sets where to start displaying bars on the x-axis.

dataPoint

Type: Object

Data point settings.

Properties

Name Type Description
showLabels Boolean Set to display labels on data points.

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".

Example using Visualization API

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

In this example we create a basic histogram, containing a single dimension and a custom title.

app.visualization.create(
  'barchart',
  [
    {
      "qDef": {
        "qFieldDefs": [
          "DrDist"
        ],
        "qFieldLabels": [
          "Drive distance"
        ]
      }
    }
  ],
  {
    "showTitles": true,
    "title": "Driving distance"
  }
).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?