• Open in:

Selecting and Marking Multiple Ranges

Click and drag on plot area to select a range on a chart. Chart creates an axis range in the place of a selection and also checks if a new range is not overlapping with previously created.

Key implementation details

We use cursor events here (selectstarted and selectended) to track selection start and end positions and then transform these positions to values using axis’ positionToValue() method. Then create (or adjust) axis ranges based on these values.

Related tutorials

Demo source