Interface: FiltersAPI

FiltersAPI

API class that is used to control filters.

Example

globalFilters.getFilters()

Methods

(async) addFilter(itemContext, filterContextopt, setOptions)

Adds a new filter to the widget.

Parameters:
Name Type Attributes Description
itemContext Object

Object ItemContext that describes filter data items context.

Properties
Name Type Attributes Description
itemId string

Data item identifier

itemIds Array.<string> <optional>

Data item identifiers for data point filters

aggregationType string <optional>

Data item aggregation type

filterContext Object <optional>

Filter context object

Properties
Name Type Attributes Description
values Array.<Object> <optional>

Array of values applied to the filter

from Object <optional>

Start range value

to Object <optional>

End range value

exclude boolean <optional>

Use filter values as exclusions

conditionsInfo Object <optional>

Filter conditions information

Properties
Name Type Attributes Default Description
conditions Object <optional>

Filter conditions

Properties
Name Type Attributes Default Description
operator Object <optional>
'containsignorecase'

Filter condition operator

values Object <optional>

Filter condition values

excludedValues Array.<string> <optional>
[]
setOptions Object

Options for visTransaction

Example
filters.addFilter({
    itemId: 'sales_and_marketing_csv.Product_line'
 }, {
    values: [{
       u: 'sales_and_marketing_csv.Year_->[2006]',
       d: '2006'
    }]
});

 filters.addFilter({
    itemId: 'sales_and_marketing_csv.Quantity'
 }, {
    from: {
       u: 0,
       d: 0
    },
    to: {
       u: 500000,
       d: 500000
    }
});

(async) editFilter(itemContext, filterContextopt, setOptions)

Edits an existing filter.

Parameters:
Name Type Attributes Description
itemContext Object

Object ItemContext that describes filter data items context.

Properties
Name Type Attributes Description
itemId string

Data item identifier

itemIds Array.<string> <optional>

Data item identifiers for data point filters

aggregationType string <optional>

Data item aggregation type

filterContext Object <optional>

Filter context object

Properties
Name Type Attributes Description
values Array.<Object> <optional>

Array of values applied to the filter

from Object <optional>

Start range value

to Object <optional>

End range value

exclude boolean <optional>

Use filter values as exclusions

setOptions Object

Options for visTransaction

Example
filters.editFilter({
    itemId: 'sales_and_marketing_csv.Product_line'
  }, {
    values: [{
        u: 'sales_and_marketing_csv.Year_->[2006]',
        d: '2006'
    }]
});

getFilterList() → {Array.<Object>}

Gets the list of filter specifications.

Returns:

Array of filter specifications

Type
Array.<Object>

(async) removeFilter(itemContext, setOptions)

Removes an existing filter

Parameters:
Name Type Attributes Description
itemContext Object

Object ItemContext that describes filter data items context.

Properties
Name Type Attributes Description
itemId string

Data item identifier

itemIds Array.<string> <optional>

Data item identifiers for data point filters

item.aggregationType string <optional>

Data item aggregation type

setOptions Object

Options for visTransaction

Example
filters.removeFilter({
		itemId: 'sales_and_marketing_csv.Product_line'
	});