Example
content.getFeature('DataPointSelections')
Methods
clearAll(transactionToken)
Clears all data point selections from the visualization
Parameters:
Name | Type | Description |
---|---|---|
transactionToken |
TransactionToken | Transaction token |
Fires:
- DataPointSelectionsAPI#event:CanvasAPI change:content:selections:clearAll
- DataPointSelectionsAPI#event:ContentAPI change:selections:clearAll
deselect(dataPointSelection, transactionToken)
Deselects data points of the visualization with the given selection spec.
Parameters:
Name | Type | Description |
---|---|---|
dataPointSelection |
Array.<DataPointSelection> | Array of data point selection spec |
transactionToken |
TransactionToken | Transaction token |
Fires:
- DataPointSelectionsAPI#event:CanvasAPI change:content:selections:deselect
- DataPointSelectionsAPI#event:ContentAPI change:selections:deselect
getSelections(selectedDataItemList) → {Array.<DataPointSelection>}
Returns the list of data point selections.
Parameters:
Name | Type | Description |
---|---|---|
selectedDataItemList |
Array | Optional array containing the selected data items |
Returns:
Array of data point selections
- Type
- Array.<DataPointSelection>
isSelected(dataPointSelection) → {boolean}
Checks whether the given resolved items are selected.
Parameters:
Name | Type | Description |
---|---|---|
dataPointSelection |
Array.<DataPointSelection> | Array of data point selection spec |
Returns:
True if the resolved items are included in the current selections.
- Type
- boolean
select(dataPointSelection, transactionToken)
Selects data points of the visualization with the given selection spec.
Parameters:
Name | Type | Description |
---|---|---|
dataPointSelection |
Array.<DataPointSelection> | Array of data point selection spec |
transactionToken |
TransactionToken | Transaction token |
Fires:
- DataPointSelectionsAPI#event:CanvasAPI change:content:selections:select
- DataPointSelectionsAPI#event:ContentAPI change:selections:select
Type Definitions
Category
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
dataItemId |
String | dataItem id of the category data |
columnId |
String | column id of the category data |
label |
String | display label of the category data |
value |
String | value of the category data |
DataPointSelection
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
categories |
Array.<Category> | Array of categeory specs |
|
facts |
Array.<Fact> |
<optional> |
Array of categeory specs |
Fact
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
dataItemId |
String | dataItem id of the fact data |
columnId |
String | column id of the fact data |
value |
String | value of the fact data |