public/libraries.js
function (e) {
            var chart = this.chart,
              hasPinched = this.hasPinched;

            if (this.selectionMarker) {
                var selectionData = {
                      xAxis: [],
                      yAxis: [],
                      originalEvent: e.originalEvent || e
                  },
                  selectionBox = this.selectionMarker,
                  selectionLeft = selectionBox.attr ? selectionBox.attr('x') : selectionBox.x,
                  selectionTop = selectionBox.attr ? selectionBox.attr('y') : selectionBox.y,
                  selectionWidth = selectionBox.attr ? selectionBox.attr('width') : selectionBox.width,
                  selectionHeight = selectionBox.attr ? selectionBox.attr('height') : selectionBox.height,
                  runZoom;

                // a selection has been made
                if (this.hasDragged || hasPinched) {

                    // record each axis' min and max
                    each(chart.axes, function (axis) {
                        if (axis.zoomEnabled) {
                            var horiz = axis.horiz,
                              minPixelPadding = e.type === 'touchend' ? axis.minPixelPadding: 0, // #1207, #3075
                              selectionMin = axis.toValue((horiz ? selectionLeft : selectionTop) + minPixelPadding),
                              selectionMax = axis.toValue((horiz ? selectionLeft + selectionWidth : selectionTop + selectionHeight) - minPixelPadding);

                            if (!isNaN(selectionMin) && !isNaN(selectionMax)) { // #859
                                selectionData[axis.coll].push({
                                    axis: axis,
                                    min: mathMin(selectionMin, selectionMax), // for reversed axes,
                                    max: mathMax(selectionMin, selectionMax)
                                });
                                runZoom = true;
                            }
                        }
                    });
                    if (runZoom) {
                        fireEvent(chart, 'selection', selectionData, function (args) {
                            chart.zoom(extend(args, hasPinched ? { animation: false } : null));
                        });
                    }

                }
                this.selectionMarker = this.selectionMarker.destroy();

                // Reset scaling preview
                if (hasPinched) {
                    this.scaleGroups();
                }
            }

            // Reset all
            if (chart) { // it may be destroyed on mouse up - #877
                css(chart.container, { cursor: chart._cursor });
                chart.cancelClick = this.hasDragged > 10; // #370
                chart.mouseIsDown = this.hasDragged = this.hasPinched = false;
                this.pinchDown = [];
            }
        }
function (e) {
            var chart = this.chart,
              hasPinched = this.hasPinched;

            if (this.selectionMarker) {
                var selectionData = {
                      xAxis: [],
                      yAxis: [],
                      originalEvent: e.originalEvent || e
                  },
                  selectionBox = this.selectionMarker,
                  selectionLeft = selectionBox.attr ? selectionBox.attr('x') : selectionBox.x,
                  selectionTop = selectionBox.attr ? selectionBox.attr('y') : selectionBox.y,
                  selectionWidth = selectionBox.attr ? selectionBox.attr('width') : selectionBox.width,
                  selectionHeight = selectionBox.attr ? selectionBox.attr('height') : selectionBox.height,
                  runZoom;

                // a selection has been made
                if (this.hasDragged || hasPinched) {

                    // record each axis' min and max
                    each(chart.axes, function (axis) {
                        if (axis.zoomEnabled) {
                            var horiz = axis.horiz,
                              minPixelPadding = e.type === 'touchend' ? axis.minPixelPadding: 0, // #1207, #3075
                              selectionMin = axis.toValue((horiz ? selectionLeft : selectionTop) + minPixelPadding),
                              selectionMax = axis.toValue((horiz ? selectionLeft + selectionWidth : selectionTop + selectionHeight) - minPixelPadding);

                            if (!isNaN(selectionMin) && !isNaN(selectionMax)) { // #859
                                selectionData[axis.coll].push({
                                    axis: axis,
                                    min: mathMin(selectionMin, selectionMax), // for reversed axes,
                                    max: mathMax(selectionMin, selectionMax)
                                });
                                runZoom = true;
                            }
                        }
                    });
                    if (runZoom) {
                        fireEvent(chart, 'selection', selectionData, function (args) {
                            chart.zoom(extend(args, hasPinched ? { animation: false } : null));
                        });
                    }

                }
                this.selectionMarker = this.selectionMarker.destroy();

                // Reset scaling preview
                if (hasPinched) {
                    this.scaleGroups();
                }
            }

            // Reset all
            if (chart) { // it may be destroyed on mouse up - #877
                css(chart.container, { cursor: chart._cursor });
                chart.cancelClick = this.hasDragged > 10; // #370
                chart.mouseIsDown = this.hasDragged = this.hasPinched = false;
                this.pinchDown = [];
            }
        }
function ( e ) { var chart = this . chart , hasPinched = this . hasPinched ; if ( this . selectionMarker ) { var selectionData = { xAxis : [ ] , yAxis : [ ] , originalEvent : e . originalEvent || e } , selectionBox = this . selectionMarker , selectionLeft = selectionBox . attr ? selectionBox . attr ( 'x' ) : selectionBox . x , selectionTop = selectionBox . attr ? selectionBox . attr ( 'y' ) : selectionBox . y , selectionWidth = selectionBox . attr ? selectionBox . attr ( 'width' ) : selectionBox . width , selectionHeight = selectionBox . attr ? selectionBox . attr ( 'height' ) : selectionBox . height , runZoom ; // a selection has been made if ( this . hasDragged || hasPinched ) { // record each axis' min and max each ( chart . axes , function ( axis ) { if ( axis . zoomEnabled ) { var horiz = axis . horiz , minPixelPadding = e . type === 'touchend' ? axis . minPixelPadding : 0 , // #1207, #3075 selectionMin = axis . toValue ( ( horiz ? selectionLeft : selectionTop ) + minPixelPadding ) , selectionMax = axis . toValue ( ( horiz ? selectionLeft + selectionWidth : selectionTop + selectionHeight ) - minPixelPadding ) ; if ( ! isNaN ( selectionMin ) && ! isNaN ( selectionMax ) ) { // #859 selectionData [ axis . coll ] . push ( { axis : axis , min : mathMin ( selectionMin , selectionMax ) , // for reversed axes, max : mathMax ( selectionMin , selectionMax ) } ) ; runZoom = true ; } } } ) ; if ( runZoom ) { fireEvent ( chart , 'selection' , selectionData , function ( args ) { chart . zoom ( extend ( args , hasPinched ? { animation : false } : null ) ) ; } ) ; } } this . selectionMarker = this . selectionMarker . destroy ( ) ; // Reset scaling preview if ( hasPinched ) { this . scaleGroups ( ) ; } } // Reset all if ( chart ) { // it may be destroyed on mouse up - #877 css ( chart . container , { cursor : chart . _cursor } ) ; chart . cancelClick = this . hasDragged > 10 ; // #370 chart . mouseIsDown = this . hasDragged = this . hasPinched = false ; this . pinchDown = [ ] ; } }
On mouse up or touch end across the entire document, drop the selection.
On mouse up or touch end across the entire document drop the selection .