Check documentation for the latest version of dhtmlxSuite Filtering DHTMLX Docs


Charts provides ability to filter data by one or several criteria. In this case, only items that match the parameters will be shown.

To filter a dataset, you need to call the filter() method. Each time the method is called, all chart data are refiltered (previous results aren't preserved).

It's possible to call the filter method in two modes:

  • filter(property,value)

This approach is used for 'contains' filtering. It is simple, but isn't flexible. The method shows items where "property" (the first parameter) contains 'value' (the second parameter). Such a filtering isn't case-sensitive:

  • filter(function)

Using function as a parameter allows to define different filter rules and to filter by multiple properties. Filtering function is called for each object of dataset, and if it returns true, the object will be displayed:

    if (obj.sales > 10 && == "Company 3") return true;
    return false;

Related sample:  Filtering

Back to top