Protected
_confProtected
_storageProtected
addProtected
applyFilter the chart by the given parameter, or return the current filter if no input parameter is given.
The filter parameter can take one of these forms:
[ [value,value,value] ]
): each value is
togglednull
: the filter will be reset by resetFiltersNote that this is always a toggle (even when it doesn't make sense for the filter type). If
you wish to replace the current filter call
chart.replaceFilter(filter)
instead.
Each toggle is executed by checking if the value is already present using the hasFilter; if it is not present, it is added using the addFilter; if it is already present, it is removed using the removeFilter.
In the Crossfilter version, once the filters array has been updated, the filters are applied to the crossfilter dimension, using the applyFilters.
Once you have set the filters, call redrawGroup (or redrawAll) to redraw the chart's group.
// filter by a single string
chart.filter('Sunday');
// filter by a single age
chart.filter(18);
// filter by a set of states
chart.filter([ ['MA', 'TX', 'ND', 'WA'] ]);
// filter by range -- note the use of filters.RangedFilter, which is different
// from the syntax for filtering a crossfilter dimension directly, dimension.filter([15,20])
chart.filter(new RangedFilter(15,20));
Generated using TypeDoc
Add this filter to existing filters.
Override this if you need to alter the default behaviour of this filter to be just appended to the current list.
TODO: link to example