isFiltered(value: Number);
value. Value of the tested Y coordinate of the line.
The isFiltered method checks if the axis line hits the filtering range.
This method returns true if the line hits the filtering range, false if the line is outside of the filtering range, and null if the filtering range is not specified.
Executing the example requires the ParallelCoordinates component named coord (see Example of Creating the ParallelCoordinates Component). Check if filtering for the second axis is running; and set filtering range if it is not:
// Check if filtering for the chart second axis is running if (coord.getAxes()[1].isFiltrationActive()) { console.log("Filtering of the second axis is already running"); } else { console.log("Starting filtering for the second axis..."); coord.getAxes()[1].setRangeMinValue(30); coord.getAxes()[1].setRangeMaxValue(350); coord.getAxes()[1].draw(); }; coord.refresh();
After executing the example a message informing that a filter is applied to the second axis, appears in the console:
Starting filtering for the second axis...
Limits of filtering range will be defined for the second axis:
Check if the first line hits filtering range of the second axis:
// Check if the first line hits filtering range of the second axis if (coord.getAxes()[1].isFiltered(dataSource.getData("line1", 0, "id2"))) { console.log("The first line hits filtering range of the second axis"); } else { console.log("The first line is outside of the filtering range for the second axis"); }
The result of checking is displayed in the console:
The first line hits filtering range of the second axis
Check if the first line has been hidden after setting filter for the second axis:
// Check if the first line becomes hidden after setting filter for the second axis if (coord.getLines()[0].getIsFiltered()) { console.log(The first line becomes hidden after setting the filter"); } else { console.log("The first line is visible after setting the filter"); }
The result of checking is displayed in the console:
The first line is visible after settings the filter
See also: