Brushing allows the selection of a range of values in a chart, in one or two dimensions. It usually involves clicking a point on the screen with a mousedown or touchstart event, moving the cursor somewhere else (mousemove or touchmove) while drawing an area on the screen, and releasing the cursor when the area is selected (mouseup, touchend, or touchcancel). These native events are grouped in three drag events: start, drag, and end that are handled by a brush behavior object.
In two-dimensional brushes, the selection is represented as two corners of a rectangle. In one-dimensional brushes, the selection is a minimum and a maximum value. The selection rectangle can also be configured with a fixed size and allowed to move over the chart. You can also attach handles that are used to resize it. Once the brushing is done, the extent of the selection is used to compute...