Chip

Overview

A chip is an attribute (hierarchy / column) or a measure (value) from the data model, that has been added to a drop zone by the user. The query is calculated based on the selected 'Chips'. The "Chips" are typically required to determine how to draw the visualization.

  • From version: 2020.20

Properties

caption

caption: string

Plain text caption for the chip. Usually contains the name of the Attribute or Measure. Can be used for displaying the chip titles in the visual.

Console.log("current chip : " + chip.caption);

chipType

chipType: ChipType

ChipType is an enumeration that indicates the type of chip: either an attribute chip (blue) or a value chip (orange). Attribute chips and Value chips have different use cases and functionality.

if(chip.chipType !== cvApi2.enums.ChipType.MeasureChip){
		Console.log("chip is a measure chip);
}

uniqueName

uniqueName: string

Unique name for the chip (attribute or value).

const chipUniqueName = chip.uniqueName;

elements

elements: Element[]

This is a list of the member element selections made in the query for this attribute. Relevant only for (blue) attribute chips.

if(chip.chipType !== cvApi2.enums.ChipType.MemberChip){
		return chip.elements;
}

maxValue

maxValue: number

Relevant only for (orange) Value chips. Getting the Chip's maximum value across all data points in the result set is useful when drawing visuals (like setting axis limits).

if(chip.chipType !== cvApi2.enums.ChipType.MeasureChip){
		Console.log("min value of" + chip.caption + " is: " + chip.maxValue);
}

minValue

minValue: number

Relevant only for (orange) Value chips. Getting the Chip's minimuim value across all data points in the result set is useful when drawing visuals (like setting axis limits).

if(chip.chipType !== cvApi2.enums.ChipType.MeasureChip){
		Console.log("min value of" + chip.caption + " is: " + chip.minValue);
}