metric

This applies to: Visual Data Discovery

The metric variable is part of the array of objects you use to define data and non-data values for this visualization.

You must be an administrator to manage custom visual types.

Type

metric

Editor

metric variables are not represented on the settings panel. Enable editing a metric variable by adding an axis label for the variable using the createAxisLabel method on the controller.

Variable Specific Properties

Property   Argument Description
colorSet string The name of the color palette to use by default. The value_inherit uses the palette from the currently selected theme. Other available values include DefaultSequential and DefaultQualitative.
metricType string Set to color to enable this metric as the color metric. Only set this to one metric on the visualization.
legendType string Available values include palette and range.
config object All properties are optional.
  displayNoneOption boolean When set to true, users can select None when choosing a field for this variable.
defaultValue array of object Enable to allow setting of a default configuration for the chosen field.
  name string A value of none combined with config.displayNoneOption set to true will default the selected field to None. A value of count will automatically select the Volumemetric.
  colorConfig object

 

    autoShowColorLegend boolean If true, show a legend for this variable by default.
    colorNumb integer The number of colors to include in the color palette by default. 0 will choose the smallest palette available.
    legendType string Available values include palette and range.
    colorScaleType string Available values include gradient and distinct.

Generic Properties

Generic properties apply to many variables.

Property Argument Description
name string The name of the property. It must be unique among all variables on the visualization. This name is used to access the data accessor and/or variable value on the controller provided to the visualization.
descr string A description of the variable for your reference. This is not displayed in the UI.
attributeType array of strings

A list of field types to include when selecting fields for this variable. Accepted values:

  • ATTRIBUTE
  • TIME
  • NUMBER
  • INTEGER
colorNumb integer The number of colors to include in the color palette by default. 0 will choose the smallest palette available.
required boolean Triggers the UI to require a value for certain variable types. Not used for this variable type.

Deprecated Properties

Property
colorMetric
groupType

Samples

{
	"name": "Bar Color",
	"type": "metric",
	"attributeType": [
		"INTEGER",
		"NUMBER"
	],
	"defaultValue": [
		{
			"name": "count",
			"colorConfig": {
				"colorNumb": 3,
				"legendType": "palette",
				"autoShowColorLegend": true
			}
		}
	],
	"config": {
		"displayNoneOption": true
		},
		"colorNumb": 3,
		"colorSet": "_inherit",
		"metricType": "color",
		"legendType": "palette",
		"required": false
}

See Visual Type Configuration Properties.