app/assets/javascripts/highcharts.js in highcharts-rails-6.0.0 vs app/assets/javascripts/highcharts.js in highcharts-rails-6.0.1

- old
+ new

@@ -1,7 +1,7 @@ /** - * @license Highcharts JS v6.0.0 (2017-10-04) + * @license Highcharts JS v6.0.1 (2017-10-05) * * (c) 2009-2016 Torstein Honsi * * License: www.highcharts.com/license */ @@ -30,11 +30,11 @@ isFirefox = /Firefox/.test(userAgent), hasBidiBug = isFirefox && parseInt(userAgent.split('Firefox/')[1], 10) < 4; // issue #38 var Highcharts = win.Highcharts ? win.Highcharts.error(16, true) : { product: 'Highcharts', - version: '6.0.0', + version: '6.0.1', deg2rad: Math.PI * 2 / 360, doc: doc, hasBidiBug: hasBidiBug, hasTouch: doc && doc.documentElement.ontouchstart !== undefined, isMS: isMS, @@ -1617,14 +1617,26 @@ * @param {Function} callback - The callback function. The function receives the * item as the first argument. Return `true` if this item satisfies the * condition. * @returns {Mixed} - The value of the element. */ - H.find = function(arr, callback) { - return (H.findPolyfill || Array.prototype.find).call(arr, callback); - }; + H.find = Array.prototype.find ? + function(arr, callback) { + return arr.find(callback); + } : + // Legacy implementation. PhantomJS, IE <= 11 etc. #7223. + function(arr, fn) { + var i, + length = arr.length; + for (i = 0; i < length; i++) { + if (fn(arr[i], i)) { + return arr[i]; + } + } + }; + /** * Map an array by a callback. * * @function #map * @memberOf Highcharts @@ -4342,11 +4354,11 @@ ''; // Add description desc = this.createElement('desc').add(); desc.element.appendChild( - doc.createTextNode('Created with Highcharts 6.0.0') + doc.createTextNode('Created with Highcharts 6.0.1') ); /** * A pointer to the `defs` node of the root SVG. * @type {SVGElement} @@ -28148,36 +28160,36 @@ /** * Column series display one column per value along an X axis. * * @sample {highcharts} highcharts/demo/column-basic/ Column chart * @sample {highstock} stock/demo/column/ Column chart - * + * * @extends {plotOptions.line} * @product highcharts highstock * @excluding connectNulls,dashStyle,gapSize,gapUnit,linecap,lineWidth,marker, * connectEnds,step * @optionparent plotOptions.column */ seriesType('column', 'line', { /** * The corner radius of the border surrounding each column or bar. - * + * * @type {Number} * @sample {highcharts} highcharts/plotoptions/column-borderradius/ * Rounded columns * @default 0 * @product highcharts highstock */ borderRadius: 0, /** * The width of the border surrounding each column or bar. - * + * * In styled mode, the stroke width can be set with the `.highcharts-point` * rule. - * + * * @type {Number} * @sample {highcharts} highcharts/plotoptions/column-borderwidth/ * 2px black border * @default 1 * @product highcharts highstock @@ -28186,11 +28198,11 @@ /** * When using automatic point colors pulled from the `options.colors` * collection, this option determines whether the chart should receive * one color per series or one color per point. - * + * * @type {Boolean} * @see [series colors](#plotOptions.column.colors) * @sample {highcharts} highcharts/plotoptions/column-colorbypoint-false/ * False by default * @sample {highcharts} highcharts/plotoptions/column-colorbypoint-true/ @@ -28203,11 +28215,11 @@ /** * A series specific or series type specific color set to apply instead * of the global [colors](#colors) when [colorByPoint](#plotOptions. * column.colorByPoint) is true. - * + * * @type {Array<Color>} * @since 3.0 * @product highcharts highstock * @apioption plotOptions.column.colors */ @@ -28217,11 +28229,11 @@ * to render sharp on screen. In some cases, when there are a lot of * densely packed columns, this leads to visible difference in column * widths or distance between columns. In these cases, setting `crisp` * to `false` may look better, even though each column is rendered * blurry. - * + * * @type {Boolean} * @sample {highcharts} highcharts/plotoptions/column-crisp-false/ * Crisp is false * @default true * @since 5.0.10 @@ -28229,11 +28241,11 @@ */ crisp: true, /** * Padding between each value groups, in x axis units. - * + * * @type {Number} * @sample {highcharts} highcharts/plotoptions/column-grouppadding-default/ * 0.2 by default * @sample {highcharts} highcharts/plotoptions/column-grouppadding-none/ * No group padding - all columns are evenly spaced @@ -28244,11 +28256,11 @@ /** * Whether to group non-stacked columns or to let them render independent * of each other. Non-grouped columns will be laid out individually * and overlap each other. - * + * * @type {Boolean} * @sample {highcharts} highcharts/plotoptions/column-grouping-false/ * Grouping disabled * @sample {highstock} highcharts/plotoptions/column-grouping-false/ * Grouping disabled @@ -28262,11 +28274,11 @@ /** * The maximum allowed pixel width for a column, translated to the height * of a bar in a bar chart. This prevents the columns from becoming * too wide when there is a small number of points in the chart. - * + * * @type {Number} * @see [pointWidth](#plotOptions.column.pointWidth) * @sample {highcharts} highcharts/plotoptions/column-maxpointwidth-20/ * Limited to 50 * @sample {highstock} highcharts/plotoptions/column-maxpointwidth-20/ @@ -28277,11 +28289,11 @@ * @apioption plotOptions.column.maxPointWidth */ /** * Padding between each column or bar, in x axis units. - * + * * @type {Number} * @sample {highcharts} highcharts/plotoptions/column-pointpadding-default/ * 0.1 by default * @sample {highcharts} highcharts/plotoptions/column-pointpadding-025/ * 0.25 @@ -28294,11 +28306,11 @@ /** * A pixel value specifying a fixed width for each column or bar. When * `null`, the width is calculated from the `pointPadding` and * `groupPadding`. - * + * * @type {Number} * @see [maxPointWidth](#plotOptions.column.maxPointWidth) * @sample {highcharts} highcharts/plotoptions/column-pointwidth-20/ * 20px wide columns regardless of chart width or the amount of data * points @@ -28312,11 +28324,11 @@ * The minimal height for a column or width for a bar. By default, * 0 values are not shown. To visualize a 0 (or close to zero) point, * set the minimal point length to a pixel value like 3\. In stacked * column charts, minPointLength might not be respected for tightly * packed values. - * + * * @type {Number} * @sample {highcharts} highcharts/plotoptions/column-minpointlength/ * Zero base value * @sample {highcharts} highcharts/plotoptions/column-minpointlength-pos-and-neg/ * Positive and negative close to zero values @@ -28332,11 +28344,11 @@ * markers and columns), is that animation is performed on updates. * On the other hand, when the series contains more points than the * crop threshold, the series data is cropped to only contain points * that fall within the plot area. The advantage of cropping away invisible * points is to increase performance on large series. . - * + * * @type {Number} * @default 50 * @product highcharts highstock */ cropThreshold: 50, @@ -28348,11 +28360,11 @@ * range will be computed as the distance between the two closest data * points. * * The default `null` means it is computed automatically, but this option * can be used to override the automatic value. - * + * * @type {Number} * @sample {highcharts} highcharts/plotoptions/column-pointrange/ * Set the point range to one day on a data set with one week * between the points * @default null @@ -28368,23 +28380,26 @@ * @excluding halo,lineWidth,lineWidthPlus,marker * @product highcharts highstock */ hover: { + /** + * @ignore-option + */ halo: false, /** * A specific border color for the hovered point. Defaults to * inherit the normal state border color. - * + * * @type {Color} * @product highcharts * @apioption plotOptions.column.states.hover.borderColor */ /** * A specific color for the hovered point. - * + * * @type {Color} * @default undefined * @product highcharts * @apioption plotOptions.column.states.hover.color */ @@ -28392,14 +28407,14 @@ /** * How much to brighten the point on interaction. Requires the main * color to be defined in hex or rgb(a) format. - * + * * In styled mode, the hover brightening is by default replaced * with a fill-opacity set in the `.highcharts-point:hover` rule. - * + * * @type {Number} * @sample {highcharts} highcharts/plotoptions/column-states-hover-brightness/ * Brighten by 0.5 * @default 0.1 * @product highcharts highstock @@ -28427,15 +28442,15 @@ /** * When this is true, the series will not cause the Y axis to cross * the zero plane (or [threshold](#plotOptions.series.threshold) option) * unless the data actually crosses the plane. - * + * * For example, if `softThreshold` is `false`, a series of 0, 1, 2, * 3 will make the Y axis show negative values according to the `minPadding` * option. If `softThreshold` is `true`, the Y axis starts at 0. - * + * * @type {Boolean} * @default {highcharts} true * @default {highstock} false * @since 4.1.9 * @product highcharts highstock @@ -28454,25 +28469,25 @@ /** * The Y axis value to serve as the base for the columns, for distinguishing * between values above and below a threshold. If `null`, the columns * extend from the padding Y axis minimum. - * + * * @type {Number} * @default 0 * @since 2.0 * @product highcharts */ threshold: 0, /** * The color of the border surrounding each column or bar. - * + * * In styled mode, the border stroke can be set with the `.highcharts-point` * rule. - * + * * @type {Color} * @sample {highcharts} highcharts/plotoptions/column-bordercolor/ * Dark gray border * @default #ffffff * @product highcharts highstock @@ -28495,11 +28510,11 @@ * Initialize the series. Extends the basic Series.init method by * marking other series of the same type as dirty. * * @function #init * @memberOf seriesTypes.column - * + * */ init: function() { Series.prototype.init.apply(this, arguments); var series = this, @@ -28895,10 +28910,12 @@ var series = this, yAxis = this.yAxis, options = series.options, inverted = this.chart.inverted, attr = {}, + translateProp = inverted ? 'translateX' : 'translateY', + translateStart, translatedThreshold; if (svg) { // VML is too slow anyway if (init) { attr.scaleY = 0.001; @@ -28912,21 +28929,23 @@ attr.translateY = translatedThreshold; } series.group.attr(attr); } else { // run the animation - - attr[inverted ? 'translateX' : 'translateY'] = yAxis.pos; - series.group.animate( - attr, + translateStart = series.group.attr(translateProp); + series.group.animate({ + scaleY: 1 + }, extend(animObject(series.options.animation), { // Do the scale synchronously to ensure smooth updating - // (#5030) + // (#5030, #7228) step: function(val, fx) { - series.group.attr({ - scaleY: Math.max(0.001, fx.pos) // #5250 - }); + + attr[translateProp] = + translateStart + + fx.pos * (yAxis.pos - translateStart); + series.group.attr(attr); } })); // delete this function to allow it only once series.animate = null; @@ -28957,54 +28976,54 @@ /** * A `column` series. If the [type](#series.column.type) option is * not specified, it is inherited from [chart.type](#chart.type). - * + * * For options that apply to multiple series, it is recommended to add * them to the [plotOptions.series](#plotOptions.series) options structure. * To apply to all series of this specific type, apply it to [plotOptions. * column](#plotOptions.column). - * + * * @type {Object} * @extends series,plotOptions.column * @excluding dataParser,dataURL * @product highcharts highstock * @apioption series.column */ /** * An array of data points for the series. For the `column` series type, * points can be given in the following ways: - * + * * 1. An array of numerical values. In this case, the numerical values * will be interpreted as `y` options. The `x` values will be automatically * calculated, either starting at 0 and incremented by 1, or from `pointStart` * and `pointInterval` given in the series options. If the axis has * categories, these will be used. Example: - * + * * ```js * data: [0, 5, 3, 5] * ``` - * + * * 2. An array of arrays with 2 values. In this case, the values correspond * to `x,y`. If the first value is a string, it is applied as the name * of the point, and the `x` value is inferred. - * + * * ```js * data: [ * [0, 6], * [1, 2], * [2, 6] * ] * ``` - * + * * 3. An array of objects with named values. The objects are point * configuration objects as seen below. If the total number of data * points exceeds the series' [turboThreshold](#series.column.turboThreshold), * this option is not available. - * + * * ```js * data: [{ * x: 1, * y: 9, * name: "Point2", @@ -29014,10 +29033,10 @@ * y: 6, * name: "Point1", * color: "#FF00FF" * }] * ``` - * + * * @type {Array<Object|Array|Number>} * @extends series.line.data * @excluding marker * @sample {highcharts} highcharts/chart/reflow-true/ Numerical values * @sample {highcharts} highcharts/series/data-array-of-arrays/