function registerApproximation() {
            if (H.approximations && !H.approximations.windbarb) {
                H.approximations.windbarb = function (values, directions) {
                    var vectorX = 0, vectorY = 0, i, len = values.length;
                    for (i = 0; i < len; i++) {
                        vectorX += values[i] * Math.cos(directions[i] * H.deg2rad);
                        vectorY += values[i] * Math.sin(directions[i] * H.deg2rad);
                    }
                    return [
                        // Wind speed
                        values.reduce(function (sum, value) {
                            return sum + value;
                        }, 0) / values.length,
                        // Wind direction
                        Math.atan2(vectorY, vectorX) / H.deg2rad
                    ];
                };
            }
        }
/**
         * Once off, register the windbarb approximation for data grouping. This can be
         * called anywhere (not necessarily in the translate function), but must happen
         * after the data grouping module is loaded and before the wind barb series uses
         * it.
         * @private
         */
Once off, register the windbarb approximation for data grouping. This can be
called anywhere (not necessarily in the translate function), but must happen
after the data grouping module is loaded and before the wind barb series uses
it.
@private
Once off register the windbarb approximation for data grouping . This can be called anywhere ( not necessarily in the translate function ) but must happen after the data grouping module is loaded and before the wind barb series uses it . @private
function registerApproximation() {
            if (H.approximations && !H.approximations.windbarb) {
                H.approximations.windbarb = function (values, directions) {
                    var vectorX = 0, vectorY = 0, i, len = values.length;
                    for (i = 0; i < len; i++) {
                        vectorX += values[i] * Math.cos(directions[i] * H.deg2rad);
                        vectorY += values[i] * Math.sin(directions[i] * H.deg2rad);
                    }
                    return [
                        values.reduce(function (sum, value) {
                            return sum + value;
                        }, 0) / values.length,
                        Math.atan2(vectorY, vectorX) / H.deg2rad
                    ];
                };
            }
        }
function registerApproximation ( ) { if ( H . approximations && ! H . approximations . windbarb ) { H . approximations . windbarb = function ( values , directions ) { var vectorX = 0 , vectorY = 0 , i , len = values . length ; for ( i = 0 ; i < len ; i ++ ) { vectorX += values [ i ] * Math . cos ( directions [ i ] * H . deg2rad ) ; vectorY += values [ i ] * Math . sin ( directions [ i ] * H . deg2rad ) ; } return [ values . reduce ( function ( sum , value ) { return sum + value ; } , 0 ) / values . length , Math . atan2 ( vectorY , vectorX ) / H . deg2rad ] ; } ; } }
Once off, register the windbarb approximation for data grouping.
Once off register the windbarb approximation for data grouping .
// Wind speed // Wind direction